PhoneGap中文网

 找回密码
 立即注册
查看: 26524|回复: 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. });
复制代码


回复

使用道具 举报

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

本版积分规则

关闭

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

ionic4视频教程

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

GMT+8, 2024-5-6 15:04 , Processed in 0.041112 second(s), 30 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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