jquery ajax readystate 0 responsetext status 0 statustext error

前端 未结 5 1447
执念已碎
执念已碎 2020-11-28 14:21

I am getting the following error: jquery ajax readystate 0 responsetext status 0 statustext error when giving it: url(http://www.tutorialspoint.com/proto

5条回答
  •  Happy的楠姐
    2020-11-28 14:49

    same origin policy. the browser does not allow when you're on

    http://site1.com
    

    to connect to:

    site2.com
    sub.site1.com
    site1:99.com
    https://site1.com (not sure about this one)
    

    This is so site1 cannot steal content from site2 and pretend it's the content of site1. Ways around this is JSONP (google maps use that I think) and having site2 provide cors headers but cors are not supported in jQuery 1.* (maybe not in 2.* either) because IE has some problems implementing it. In both situations you need site2 to cooperate with your site so your site can display it's content.

    If you only use this yourself then you can use Firefox and install the forcecors plugin. To activate you can choose view => toolbars => add on bar and click on the text "cors" in the right bottom of the screen.

提交回复
热议问题