2016-11-26 75 views
0

我想要一個背景圖片添加到我的流星的webapp:不允許加載本地資源流星應用

background: url('../public/img/car.jpg') no-repeat center center fixed; 

但後來我收到以下錯誤信息:

jquery.js?hash=c334cf5…:3662 Not allowed to load local resource: file:///D:/project/app/public/car.jpg 

我在想什麼?

+0

您使用的是科爾多瓦嗎?請看看[這](http://stackoverflow.com/questions/28503179/cordova-meteor-app-not-allowed-to-load-local-resource)回答 – blueren

+0

不,我不使用科爾多瓦,它的一個標準的流星webapp –

+0

您使用瀏覽器策略?背景是否實際顯示?雖然這個問題可能正如基督徒所說的那樣。 – StorytellerCZ

回答

0

我終於在這裏找到了答案: meteor app: images not loading

文件中/公共供應到客戶端,是

所以我不得不排除文件路徑,只需鍵入/car.png

1

我想你可能會誤解public文件夾的使用(請參閱directory structure上的文檔)。該文件夾中的任何內容都將在/網址上靜態投放。所以,我認爲你需要改變的是:

background: url('/img/car.jpg') no-repeat center center fixed; 
相關問題