Sch*_*iss 9 javascript php jquery
我试图使用这段代码序列化一个表单并同时发送一个在表单中找不到的额外变量.以下代码行是我所期望的,但遗憾的是不起作用.
var thePage = theFilename();
$.post("pagedetail.php", { $("#PageDetailForm").serialize(), thePage: thePage },
function(data) {
alert(data);
});
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
var serialized = $('#PageDetailForm').serialize();
serialized.thePage = thePage;
$.post("pagedetail.php", serialized,
function(data) {
alert(data);
});
Run Code Online (Sandbox Code Playgroud)