2014-03-04 3 views
0

이 두 함수는 IE에서만 작동하는 것 같습니다. 다음 코드입니다.내 코드가 크롬이나 FF에서 작동하지 않는 이유

function onGridMembers(id,xml) { 
    if (xml != "<Members/>" && ToHelpOrNotToHelp) { 
     var domDoc = new ActiveXObject("Microsoft.XMLDOM"); 
     domDoc.loadXML(xml); 
     var helpHtml2 = ""; 
     var xmlhttp = new XMLHttpRequest(); 
     xmlhttp.open("GET", "Dictionary.xml", true); 
     xmlDictionary = xmlhttp.responseXML; 
     xmlhttp.send();  
     helpHtml2 += xmlDictionary.selectSingleNode("Terms/Term[Key='" + domDoc.selectSingleNode("Members/Member/@UName").text + "']/Desc").text; 
     alert(helpHtml2);   
    } 
} 



function onCommandClicked(nectoId, commandId, commnadCaption, xml) { 

    if (commandId == "ID223") {    // this one doesn't work in chrome 
     window.open('file://server/Guide.docx'); 
    } else if (commandId == "ID225") {   // This one works in chrome 
     window.open('http://server/Reports/Pages/Folder.aspx');       
    } else if (commandId == "ID227") {  // this one doesn't work in chrome 
     getComponentById("vvv","ww").setMenuItemState("ID227", "Hidden"); 
     getComponentById("vvv","ww").setMenuItemState("ID226", "Enable"); 

     ToHelpOrNotToHelp = false;   
    } else if (commandId == "ID226") {  // this one doesn't work in chrome 
     getComponentById("vvv","ww").setMenuItemState("ID226", "Hidden"); 
     getComponentById("vvv","ww").setMenuItemState("ID227", "Enable"); 

     ToHelpOrNotToHelp = true; 
    } 
} 

도와 주실 수 있습니까?

+1

Internet Explorer 전용 ActiveX 개체 ('Microsoft.'가 더 암시 함)를 사용하여 IE 외부에서 작동하지 않는 이유가 궁금합니다 ... –

+0

https://developer.mozilla.org/en-US/docs/ 구문 분석 및 직렬화 XML – CBroe

답변

0

두 번째 코드는 확실하지 않지만 MS 전용 인 ActiveX를 사용하고 있기 때문에 첫 번째 코드는 IE가 아닌 다른 브라우저에서 작동하지 않습니다.

Firefox 오류 콘솔은 일반적으로 JS가 작동하지 않는 이유에 대한 유용한 정보를 제공합니다.

관련 문제