簡要地說,我想在互聯網上(不是在我的網站上)加載引導程序css文件web page,在瀏覽器控制檯中使用Javascript對其進行一些自定義。如何從JavaScript加載和外部的CSS文件?
我試圖使用jQuery像這樣從CDN加載引導:
$("head").append("<link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css' type='text/css' />");
如果這樣做,我收到此錯誤信息:
我應該怎麼做才能成功加載到頁面?
檢查https://stackoverflow.com/questions/27323631/how-to-override-content-security-policy-while-including-script-in-browser-js-con –