function createXHR(){
var xhr = null;
if(window.XMLHttpRequest){//判断当前浏览器是否支持XMLHttpRequest
xhr = new XMLHttpRequest();
}else if(window.ActiveXObject){
var aVersions = ["MSXML2.XMLHttp", "Microsoft.XMLHttp", "MSXML2.XMLHttp.5.0", "MSXML2.XMLHttp.4.0", "MSXML2.XMLHttp.3.0"];
for(var i=0;i<aVersions.length;i++){
try{
xhr = new ActiveXObject(aVersions[i]);//IE的各版本支持的
break;
}catch(e){
if(i == aVersions.length-1){
errorMsg('XMLHttpRequest创建失败!');
}
}
}
}
return xhr;
}
function errorMsg(msg){
alert(msg);
}
function getQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var urlObj = window.location;
var r = urlObj.href.indexOf('#') > -1 ? urlObj.hash.split("?")[1].match(reg) : urlObj.search.substr(1).match(reg);
if (r != null) return unescape(r[2]); return null;
}
var requestId=getQueryString("woID");
$CS.setValue("WorkOrder_Fields_UDF_CHAR1",requestId);
//(最后这条是把值赋予到相应的字段上,系统字段会选择的到可以基于引导加入)