简体   繁体   中英

Javascript Code giving error on chrome and firefox

I have used below lines in my code for consuming web services using javascript

var ns = (wsdl.documentElement.attributes["targetNamespace"] + "" == "undefined") ? wsdl.documentElement.attributes.getNamedItem("targetNamespace").nodeValue : wsdl.documentElement.attributes["targetNamespace"].value;

the above javascript code is running fine on IE and safari but on chrome and firefox it is throwing error on console:

XMLHttpRequest cannot load http://192.168.50.141:4323/HelloWorld.asmx?wsdl. Origin null is not allowed by Access-Control-Allow-Origin.
Uncaught TypeError: Cannot read property 'documentElement' of null 

Please Help

Thanks in Advance

If you run chrome with the command line

like

chrome.exe --disable-web-security

This is what i use when developing

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM