我正在使用AjaxForm 插件
我想提醒数据正在推送到服务器的内容。
<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>
这是在jsp中的循环,因此表单不止一次生成具有class -> frmAppList。
我正在使用该类来应用ajaxform,如下所示:
$('.frmAppList').ajaxForm({
url : 'urltoserver',
dataType : 'json',
type : 'post',
beforeSubmit : function() {
return false;
//something here that gives me the device id that is passed
//since the form is not one I cant use id, also every form has **deviceid**
//i need to get that deviceid so that i can pass it in **success** ajax call
//at ***Label->(A)***
},
success : function(response) {
if (response.status) {
//***Label*** ->(A)
//have to call other ajax call to take the data
//for that i need the device id that is going in this ajax call
}
},
error : function(xhr, ajaxOptions, thrownError) {
alert('error');
},
timeout :10000
});
我怎样才能获得该设备 ID,请帮助我.... 非常感谢.....