首页 > 代码库 > js 的post提交的写法

js 的post提交的写法

function AddEditDevice(data){var form = $("#deviceEditform");if (form.length == 0) {form = $("<form id=‘deviceEditform‘ action=‘/sites/device.aspx‘ method=‘get‘ target=‘_blank‘ style=‘display:none‘></form>");$("body").append(form);}form.empty();form.append(Elm("Action").val(data["action"]));if(data["id"]) form.append(Elm("deviceId").val(data["id"]));if(data["orgId"]!=undefined) form.append(Elm("orgId").val(data["orgId"]));if(data["type"]!=undefined) form.append(Elm("deviceClass").val(data["type"]));if(data["target"]!=undefined) form.attr("target",data["target"]);form.append(Elm("n").val(new Date().getTime()));form.submit();	}

 

注意这种写法   添加控件

var cSearchAction = CurrentPage.LoadControl("~/UserControls/Device/DeviceSearchAction.ascx");
ISearchActionControl = cSearchAction as IDeviceActionControl;