0
我用下面的線在我的代碼使用JavaScriptJavaScript代碼給於Chrome和Firefox
var ns = (wsdl.documentElement.attributes["targetNamespace"] + "" == "undefined") ? wsdl.documentElement.attributes.getNamedItem("targetNamespace").nodeValue : wsdl.documentElement.attributes["targetNamespace"].value;
上述JavaScript程式碼使用Web服務是在IE和Safari瀏覽器上運行良好,但在Chrome和Firefox的錯誤是在控制檯上拋出錯誤:
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
請幫助
由於提前
'原產地空沒有被允許當我使用訪問控制允許-Origin.'告訴原因。 – xdazz 2012-08-17 09:36:11
你在哪裏運行代碼?它確實不在'http://192.168.50.141:4323 /'上? – pimvdb 2012-08-17 09:36:53