Jquery load https url

后端 未结 3 662
遇见更好的自我
遇见更好的自我 2021-01-12 09:26

I have this problem. In external web site I have a script like this:

3条回答
  •  逝去的感伤
    2021-01-12 10:02

    I think it is more a problem of cross origin domain.

    the $.load function of jquery use ajax to load the url and so you cannot do cross domain call if the target URL does not implement CORS headers.

    In your example, the server example.com must return a header

    Access-Control-Allow-Origin: *
    

    You can also replace * with the domain of the page that want to load the content by AJAX.

    A good blog post on how to use CORS: http://www.html5rocks.com/en/tutorials/cors/

提交回复
热议问题