Permission Denied Error XMLHttpRequest

后端 未结 3 1024
梦毁少年i
梦毁少年i 2021-01-25 13:33
  
    


        
相关标签:
3条回答
  • 2021-01-25 13:45

    Since you're setting Content-type, you need to also set it to use UTF-8. And I think it's supposed to be application/xml (source).

    xmlhttp.setRequestHeader("Content-Type", "application/xml; charset=utf-8");
    

    Otherwise, have you verified that the XML is properly formatted? Try saving it as a complete XML file and open it in your browser.

    0 讨论(0)
  • 2021-01-25 13:53

    For Internet Explorer

    http://www.simple-talk.com/dotnet/asp.net/calling-cross-domain-web-services-in-ajax/

    For Firefox

    http://installingcats.com/2008/01/29/how-to-fix-ajax-error-uncaught-exception-permission-denied-to-call-method-xmlhttprequestopen/

    0 讨论(0)
  • 2021-01-25 14:01

    XmlHttpRequest can only be used to call services local to the domain/server from where the page is being served.

    Thus, if you're serving a page from:

    http://www.example.com/page1
    

    You cannot make an XmlHttpRequest to:

    http://www.sample.com/webservice
    
    0 讨论(0)
提交回复
热议问题