Same origin policy

前端 未结 4 653
悲哀的现实
悲哀的现实 2020-12-06 13:59

Maybe some of you can help me get a better understanding of the javascript same origin policy.

The same origin policy is defined as following (http://en.wikipedia.or

4条回答
  •  一整个雨季
    2020-12-06 14:35

    You can get Yahoo Finance using JSONP, so that is most definitely what you are using.

    An example URL is...

    http://d.yimg.com/autoc.finance.yahoo.com/autoc?query=Apple&callback=YAHOO.Finance.SymbolSuggest.ssCallback
    

    When the request has loaded, it will call the callback you define in the GET param. This allows you to work around same origin policy, provided the service has support for JSONP.

    Alternatively, some people use their server as a proxy.

提交回复
热议问题