[英]display another website domain template on project using angularjs
so I had an http call using angularjs 所以我用angularjs打电话了
$http.get(link).then(function(data, response, header) {
console.log(data.data.url);
});
which is returned with an JSON body like this 带有这样的JSON正文返回的
{url:"http://www.example.com/article/1"}
and I want to display it to the container that I've made, let say the container is this 我想将其显示在我制作的容器中,假设容器是这个
<div id="containerArticle"></div>
I tried it using iframe but it gives me an error Load denied by X-Frame-Options
which is the domain is forbid me to using iframe. 我使用iframe尝试了此操作,但它给我一个错误
Load denied by X-Frame-Options
,因为该域禁止我使用iframe。
my question is, what is the best approach of displaying content of another domain using angualrjs ? 我的问题是,使用angualrjs显示另一个域的内容的最佳方法是什么? I've been stuck for 2 days now..
我已经被困了两天了。
You can consider JSONP if you are only doing Get requests. 如果仅执行Get请求,则可以考虑JSONP。
Another approach is to create a proxy page on your server that in turn makes a request to the other domain. 另一种方法是在服务器上创建一个代理页面,该代理页面又向另一个域发出请求。 This is often referred to as a reverse proxy.
这通常称为反向代理。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.