如何使用ajax / javascript将页面从另一个域调用到我的域 [英] How to call a page from another domain to my domain using ajax/javascript

查看:95
本文介绍了如何使用ajax / javascript将页面从另一个域调用到我的域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用ajax / javascript调用并显示从另一个域到我的域的页面。我想隐藏页面的原始网址。 (例如,在surveymoneky的情况下,我可以在我的网站上加载调查页面而不显示surverymonkyes url。)

I would like to call and show a page from another domain to my domain using ajax/javascript. I would like to hide the original url of the page. (Example in the case of surveymoneky, I can load the survey page in my web site with out showing the surverymonkyes url.)

我该怎么办?

提前致谢..

问候,

Sunil

推荐答案

由于浏览器中实施了SOP(同源策略),您只能使用其他域中的信息检索Ajax,如果其他域允许通过将 Access-Control-Allow-Origin 响应头设置到发出请求的域。

Due to the SOP (same origin policy) implemented in browsers, you can only retrieve information from another domain using Ajax if the other domain allows that by setting the Access-Control-Allow-Origin response header to the domain where the request originated.

这篇关于如何使用ajax / javascript将页面从另一个域调用到我的域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆