文章詳情頁(yè)
angular.js - angularjs的ng-include的html必須是要在同一個(gè)服務(wù)器嗎?
瀏覽:160日期:2024-03-13 16:15:16
問(wèn)題描述
想實(shí)現(xiàn)其他服務(wù)器的播放器到當(dāng)前頁(yè)面中,求問(wèn)應(yīng)該怎么實(shí)現(xiàn)?
問(wèn)題解答
回答1:使用ng-include引入的文件必須是同一個(gè)域名下,所以想要實(shí)現(xiàn)的可能需要另辟蹊徑了
回答2:默認(rèn)是同源策略,如果你想加載其他不在同一個(gè)域的資源,你需要了解 $sce,設(shè)置白名單這是官網(wǎng)一段描述
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.
標(biāo)簽:
HTML
上一條:angular.js - angular中的controller 的js文件如何修改css樣式比如margin:0?下一條:前端 - 應(yīng)該先從angularJS , vue.js , react 這些框架中的哪個(gè)開(kāi)始入手?
相關(guān)文章:
1. android - weex 項(xiàng)目createInstanceReferenceError: Vue is not defined2. javascript - 如圖,百度首頁(yè),查看源代碼為什么什么都沒(méi)有?3. 網(wǎng)頁(yè)爬蟲(chóng) - python requests爬蟲(chóng),如何post payload4. npm鏡像站全新上線5. angular.js - 求問(wèn)大神?angularjs加載外部的html模板。有閃動(dòng)如何解決6. html - 關(guān)于CSS實(shí)現(xiàn)border的0.5px設(shè)置?7. PHPExcel表格導(dǎo)入數(shù)據(jù)庫(kù)怎么導(dǎo)入8. android - 哪位大神知道java后臺(tái)的api接口的對(duì)象傳到前端后輸入日期報(bào)錯(cuò),是什么情況?求大神指點(diǎn)9. pdo 寫(xiě)入到數(shù)據(jù)庫(kù)的內(nèi)容為中文的時(shí)候?qū)懭雭y碼10. PHP類封裝的插入數(shù)據(jù),總是插入不成功,返回false;
排行榜

熱門標(biāo)簽