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

<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

 

posted @ 2015-01-25 21:51  wintys  阅读(1907)  评论(0编辑  收藏  举报