Home > front end >  Js secondary linkage is not compatible with how to solve
Js secondary linkage is not compatible with how to solve

Time:09-25

Js secondary linkage, under the IE is ok, the IE browser is not compatible, how to solve the
 
<script language="javascript" type="text/javascript" & gt;
Function load (every)//every ID to accept delivery categories
{
Var dlstSecond=document. GetElementById (" DropDownList2 ");
Function RemoveAll (oElem)//clear dlstSecondClass all items of all
{
var i=0;
For (I=oElem. Length; I & gt;=0; I -) {
OElem. Options. Remove (I);
}
}
RemoveAll (dlstSecond);
//var oHttpReq=new ActiveXObject (" MSXML2. XMLHTTP ");
Var oHttpReq=null;

If (window. The XMLHttpRequest) {
OHttpReq=new XMLHttpRequest ();
Alert (oHttpReq);
}
The else {
}
if (! OHttpReq & amp; & Window. The ActiveXObject) {
Try {
OHttpReq=new ActiveXObject (" Msxml2. XMLHTTP. 5.0 ")
}
The catch (e) {
Try {
OHttpReq=new ActiveXObject (" Msxml2. XMLHTTP. 4.0 ")
}
The catch (e) {
Try {
New ActiveXObject (" Msxml2 XMLHTTP ")
}
The catch (e) {
Try {
New ActiveXObject (" Microsoft. XMLHTTP ")
} the catch (e) {}
}
}
}
}

//alert (' 0 k1 ');
Var oDoc=new ActiveXObject (" MSXML2. DOMDocument ");

//call read small class data page, transfer types number in the past,
OHttpReq. Open (" POST ", "getData. Aspx? Every="+ every, false);
OHttpReq. Send (" ");
Result=oHttpReq. The responseText;
ODoc. LoadXML (result);
//read all request types belong to small class class name
Item1=oDoc. SelectNodes ("//second/Table/secondClassName ");
//read all request types belong to small class number
//alert (result);//input return value

Item2=oDoc. SelectNodes ("//second/Table/secondClassId ");
Var itemsLength=item1. Length;
If (itemsLength==0) {//whether the return value is empty
Var newOption=document. The createElement method (" OPTION ");
NewOption. Text="- please select a small class -";
NewOption. Value=https://bbs.csdn.net/topics/0;
DlstSecond. Options. The add (newOption);
}
The else {
For (I=0; i //add small class class name and number to dlstSecondClass controls
Var newOption=document. The createElement method (" OPTION ");
NewOption. Text=item1 [I]. The text;
NewOption. [I] value=https://bbs.csdn.net/topics/item2. The text;
DlstSecond. Options. The add (newOption);
}
}
}
Window. The onl oad=function () {load (' 0 '); }
<script>

Is this var oDoc=new ActiveXObject (" MSXML2. DOMDocument "); You don't succeed, change this to:

 
Var oDoc=CreateXMLDOM ();
The function CreateXMLDOM () {
Var ActiveX=new Array (" MSXML2. DOMDocument. 5.0 ",
"MSXML2. DOMDocument. 4.0",
"MSXML2. DOMDocument. 3.0",
"MSXML2. DOMDocument",
"Microsoft. XMLDOM",
"MSXML. DOMDocument");
For (var I=0; i Try {
Alert (I + '-- a');
Return new ActiveXObject (ActiveX [I]);
}
The catch (e)
{
Alert (e.m essage + '-' + I);
}
}
return null;
}

Is still an error, how to solve the
Results: under the IE

CodePudding user response:


Such payment is no problem, but to participate in, when acquiring the openid to refresh the page, the parameter is missing, how to solve, session, cookie seems to be no matter to use
  • Related