AngularJS请求数据提示resource from url not allowed by $sceDelegate policy
2024-09-03 20:22:50
AngularJS iframe跨域打开内容时报错
解决方案 使用 $sceDelegateProvider 配置跨域请求域名
config.js
app.config(function($sceDelegateProvider) {
$sceDelegateProvider.resourceUrlWhitelist([
// Allow same origin resource loads.
'self',
// Allow loading from our assets domain. Notice the difference between * and **.
'http://www.baidu.com/**']);
});
xx.js
$sce.trustAsResourceUrl(pdf.Url)
html:
<iframe style="width:100%; height:1000px;" frameborder="0" ng-src="{{pdf.Url}}"></iframe>
最新文章
- 为什么 NaN 不等于自身?
- Web前端温故知新-CSS基础
- Python之路【第六篇】python基础 之面向对象(一)
- TortoiseSVN-1.8.11 安装时弹出2503错误导致安装失败解决办法
- oracle 删除表和数据分析语句
- Unity3D之Mecanim动画系统学习笔记(二):模型导入
- Extjs之success、failure
- 【转】Android LCD(三):Samsung LCD接口篇
- System.Web.Caching.Cache类 缓存 各种缓存依赖
- swift菜鸟入门视频教程-07-闭包
- APP H5 混合自动化使用说明 [基于 Appium+Python 系列]
- Oracle问题之字符集问题,登陆sqlplus出现问号
- dsu on tree 树上启发式合并 学习笔记
- 不小心跳进安装Django-redis的坑
- Measuring Text Difficulty Using Parse-Tree Frequency
- Python测试框架之Unittest梳理
- python基本数据类型 数字 和 字符串
- oracle用户权限和角色
- ASP:当 request.cookies 发生 Microsoft VBScript 运行时错误 (0x800A000D) 类型不匹配: &#39;[string:
- 实时计算DStream下求平均值(reduceByKey or combineByKey)
热门文章
- pymysql模块学习
- 1.spring源码-BeanPostProcessor后置处理器
- 数据库ETL同步 cdc开启,Git同步url添加用户名密码
- EF中的持久化场景
- django 搭建一个投票类网站(三)
- uGUI源码调试
- PHP+jPaginate插件制作无刷新分页实例
- Django - installing mysqlclient error: mysqlclient 1.3.13 or newer is required; you have 0.9.3
- JS高级---函数的几个成员
- quartus 9.0 对话框显示不完整