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(); }