文章詳情頁
angular.js - angularjs的ng-include的html必須是要在同一個(gè)服務(wù)器嗎?
瀏覽:248日期:2024-03-13 16:15:16
問題描述
想實(shí)現(xiàn)其他服務(wù)器的播放器到當(dāng)前頁面中,求問應(yīng)該怎么實(shí)現(xià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è)開始入手?
相關(guān)文章:
1. javascript - immutable配合react提升性能?2. javascript - sublime快鍵鍵問題3. javascript - nodejs關(guān)于進(jìn)程間發(fā)送句柄的一點(diǎn)疑問4. Apache 已經(jīng)把網(wǎng)站根目錄的改為allow from all了,但是服務(wù)器還是不能訪問?5. 實(shí)現(xiàn)bing搜索工具urlAPI提交6. javascript - 移動(dòng)端上不能實(shí)現(xiàn)拖拽布局嗎?7. vue.js - Vue 如何像Angular.js watch 一樣監(jiān)聽數(shù)據(jù)變化8. phpstudy8.1支持win11系統(tǒng)嗎?9. 配置Apache時(shí),添加對(duì)PHP的支持時(shí)語法錯(cuò)誤10. css - 寫頁面遇到個(gè)布局問題,求大佬們幫解答,在線等,急!~
排行榜

熱門標(biāo)簽
網(wǎng)公網(wǎng)安備