How do you get content from another domain with .load()?

后端 未结 4 1786
无人及你
无人及你 2020-12-08 12:46

Requesting data from any location on my domain with .load() (or any jQuery ajax functions) works just fine.

Trying to access a URL in a different domain doesn\'t wor

4条回答
  •  执念已碎
    2020-12-08 13:10

    One really easy workaround is to use Yahoo's YQL service, which can retrieve content from any external site.

    I've successfully done this on a few sites following this example which uses just JavaScript and YQL. http://icant.co.uk/articles/crossdomain-ajax-with-jquery/using-yql.html

    This example is a part of a blog post which outlines a few other solutions as well. http://www.wait-till-i.com/2010/01/10/loading-external-content-with-ajax-using-jquery-and-yql/

提交回复
热议问题