首页 > Web开发 > 详细

[原]AngularJS iframe打开不同域的内容时报错误

时间:2015-01-25 22:28:28      阅读:482      评论:0      收藏:0      [点我收藏+]

<iframe id="myFrame" ng-src="{{url}}" width="100%" height="100%" seamless frameborder="0" ></iframe>

打开不同域的内容时报下面的错误:
Blocked loading resource from url not allowed by $sceDelegate policy

 

app.config(function($sceDelegateProvider) {
   $sceDelegateProvider.resourceUrlWhitelist([
       // Allow same origin resource loads.
       ‘self‘,
       // Allow loading from our assets domain.  Notice the difference between * and **.
       ‘http://media.w3.org/**‘]);
});

 

[参考]: 

http://stackoverflow.com/questions/21884666/angular-js-handling-ng-repeated-html5-video-sce

 

[原]AngularJS iframe打开不同域的内容时报错误

原文:http://www.cnblogs.com/wintys/p/angularjs_sceDelegate.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!