angular.js - angularjs的ng-include的html必须是要在同一个服务器吗?
伊谢尔伦
伊谢尔伦 2017-05-15 17:09:35
[AngularJS讨论组]

想实现其他服务器的播放器到当前页面中,求问应该怎么实现?

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

全部回复(2)
高洛峰

使用ng-include引入的文件必须是同一个域名下,所以想要实现的可能需要另辟蹊径了

PHP中文网

默认是同源策略,如果你想加载其他不在同一个域的资源,你需要了解 $sce,设置白名单
这是官网一段描述

By default, the template URL is restricted to the same domain and protocol as the application document. This is done by calling $sce.getTrustedResourceUrl on it. To load templates from other domains or protocols you may either whitelist them or wrap them as trusted values. Refer to Angular's Strict Contextual Escaping.
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号