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>

最新文章

  1. 为什么 NaN 不等于自身?
  2. Web前端温故知新-CSS基础
  3. Python之路【第六篇】python基础 之面向对象(一)
  4. TortoiseSVN-1.8.11 安装时弹出2503错误导致安装失败解决办法
  5. oracle 删除表和数据分析语句
  6. Unity3D之Mecanim动画系统学习笔记(二):模型导入
  7. Extjs之success、failure
  8. 【转】Android LCD(三):Samsung LCD接口篇
  9. System.Web.Caching.Cache类 缓存 各种缓存依赖
  10. swift菜鸟入门视频教程-07-闭包
  11. APP H5 混合自动化使用说明 [基于 Appium+Python 系列]
  12. Oracle问题之字符集问题,登陆sqlplus出现问号
  13. dsu on tree 树上启发式合并 学习笔记
  14. 不小心跳进安装Django-redis的坑
  15. Measuring Text Difficulty Using Parse-Tree Frequency
  16. Python测试框架之Unittest梳理
  17. python基本数据类型 数字 和 字符串
  18. oracle用户权限和角色
  19. ASP:当 request.cookies 发生 Microsoft VBScript 运行时错误 (0x800A000D) 类型不匹配: &#39;[string:
  20. 实时计算DStream下求平均值(reduceByKey or combineByKey)

热门文章

  1. pymysql模块学习
  2. 1.spring源码-BeanPostProcessor后置处理器
  3. 数据库ETL同步 cdc开启,Git同步url添加用户名密码
  4. EF中的持久化场景
  5. django 搭建一个投票类网站(三)
  6. uGUI源码调试
  7. PHP+jPaginate插件制作无刷新分页实例
  8. Django - installing mysqlclient error: mysqlclient 1.3.13 or newer is required; you have 0.9.3
  9. JS高级---函数的几个成员
  10. quartus 9.0 对话框显示不完整