我需要通过ajax发送选中的复选框数据。我将数据存储在一个变量对象中并通过ajax传递该变量,但在传递数据时它显示错误。 NS_ERROR_XPC_NOT_ENOUGH_ARGS:参数不足
\$(document).ready( function(){
\$("#target").click(function() // #target is the button on which click event is called
{
someObj.loadGranted = [];
someObj.loadDenied = [];
\$("input:checkbox").each(function()
{
if (\$(this).is(":checked")) {
someObj.loadGranted.push(\$(this).attr("value"));
someObj.loadGranted.push(\$(this).hide());
}
else
{
someObj.loadDenied.push(\$(this).attr("id"));
}
});
var obj =someObj.loadGranted;
alert("Granted:" +obj);
alert("DENIED: " + someObj.loadDenied);
//var selData={};
// var selData=someObj.loadGranted;
//alert("seldata is "+selData);
\$.ajax({
type: "POST",
url: "macrocall.cgi",
data: { macro: "lcinsertdb", CGISESSID: "$CGISESSID",Dataselected:obj}
})
.done(function( msg ) {
alert( "Data Selected: " + msg );
});
});
});
我无法通过var obj。它给出了错误,请建议可以做什么。 提前谢谢。