Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/85.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Ajaxform在调用submit之前获取数据_Javascript_Jquery_Html_Ajaxform - Fatal编程技术网

Javascript Ajaxform在调用submit之前获取数据

Javascript Ajaxform在调用submit之前获取数据,javascript,jquery,html,ajaxform,Javascript,Jquery,Html,Ajaxform,我和你一起工作 我想提醒数据正在推送到服务器的内容 <form class='frmAppList'> <input type='hidden' name='deviceid' value='<deviceId>'> <input type='hidden' name='operationtype' value='<Coming from server>'> <input type='hidden' nam

我和你一起工作

我想提醒数据正在推送到服务器的内容

<form class='frmAppList'>
    <input type='hidden' name='deviceid' value='<deviceId>'>
    <input type='hidden' name='operationtype' value='<Coming from server>'>
    <input type='hidden' name='type' value='command'>
    <button type="submit" class='btnAppsList button'>
         APPS LIST
    </button>
</form>
我如何获得设备Id,请帮助我。。。。 非常感谢….

来自ajaxForm文档:

success
Callback function to be invoked after the form has been submitted. If a 'success' callback function is provided it is invoked after the response has been returned from the server. It is passed the following arguments:
1.) responseText or responseXML value (depending on the value of the dataType option).
2.) statusText
3.) xhr (or the jQuery-wrapped form element if using jQuery < 1.4)
4.) jQuery-wrapped form element (or undefined if using jQuery < 1.4)
Default value: null

好的,我知道了,但是我如何访问deviceId,如果我说
alert(form)
,它说[object,object],如果我说
JSON.stringify(form)
,它抛出的错误是:在无法进行选择的输入元素上访问selectionDirection。这就是为什么我编写了console.log,而不是alert。您需要使用firebug或google chrome的开发者控制台。
success
Callback function to be invoked after the form has been submitted. If a 'success' callback function is provided it is invoked after the response has been returned from the server. It is passed the following arguments:
1.) responseText or responseXML value (depending on the value of the dataType option).
2.) statusText
3.) xhr (or the jQuery-wrapped form element if using jQuery < 1.4)
4.) jQuery-wrapped form element (or undefined if using jQuery < 1.4)
Default value: null
success : function(response,status,request,form) {
  console.log(request,form);
}