PhoneGap中文网

 找回密码
 立即注册
查看: 26437|回复: 1
打印 上一主题 下一主题

AngularJS请求数据提示resource from url not allowed by $sceDelegate policy

[复制链接]

493

主题

2035

帖子

6894

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
6894
跳转到指定楼层
楼主
发表于 2015-12-10 09:55:40 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
AngularJS iframe跨域打开内容时报错以及
AngularJS video src绑定数据的时候会提示下面错误  红色部分错误 解决方案


  1.   <video id="video_a" ng-src="{{listData['video_url']}}"  width="100%" preload="auto" controls="true"  poster="{{ENV.videoUrl}}{{listData.img}}">
  2.             Your browser does not support the video tag.
  3.         </video>
复制代码




Error: [$interpolate:interr] Can't interpolate: {{listData['video_url']}}
Error: [$sce:insecurl] Blocked loading resource from url not allowed by $sceDelegate policy

解决方案 使用  
$sceDelegateProvider  配置跨域请求域名
  1. app.config(function($sceDelegateProvider) {
  2.    $sceDelegateProvider.resourceUrlWhitelist([
  3.        // Allow same origin resource loads.
  4.        'self',
  5.        // Allow loading from our assets domain.  Notice the difference between * and **.
  6.        'http://media.w3.org/**']);
  7. });
复制代码


回复

使用道具 举报

11

主题

529

帖子

1418

积分

金牌会员

Rank: 6Rank: 6

积分
1418
沙发
发表于 2016-3-10 11:31:31 | 只看该作者
这个比较有用  iframe 和video   embed 这样的标签的时候可能会遇到
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

站长推荐 上一条 /1 下一条

ionic4视频教程

Archiver|手机版|小黑屋| PhoneGap中文网 ( 京ICP备13027796号-1 )  

GMT+8, 2024-4-24 13:27 , Processed in 0.037474 second(s), 30 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表