开发者

How do you populate a DIV with URL from another domain?

开发者 https://www.devze.com 2023-01-03 08:13 出处:网络
I know it\'s not possible on the开发者_Python百科 client to fill a DIV with content from another domain. However, I\'ve used the Google Feeds code and it\'s pulling information from other domains into

I know it's not possible on the开发者_Python百科 client to fill a DIV with content from another domain. However, I've used the Google Feeds code and it's pulling information from other domains into a DIV (no iframe) without resorting to server-side code, so I'm assuming somehow it's doable. Thanks.


From the F.A.Q.:

If the AJAX Feed API is a JavaScript API, how does it access public feeds without violating the same origin security policy?

Google.com serves as a proxy to the outside feeds, so your client code only communicates with Google servers.

So, yeah, it's doing something server-side.


To fill your div with content from a different script, you would need to request the content via ajax and pass the right params along with your request.

Edited after @JacobM comment

You can give CROSS DOMAIN AJAX: A QUICK SUMMERY a look along with AJAX Cross Domain Proxy.

0

精彩评论

暂无评论...
验证码 换一张
取 消