2013-07-19 54 views
0

我在WEB-INF文件夾中有some.jsp。在jsp裏面我有下面的代碼。圖像未加載到WEB-INF文件夾內?

<script type="text/javascript" src="../public/js/jquery-1.4.1.min.js"></script> 
<script type="text/javascript" src="../public/js/form.js"></script> 

內部form.js我有以下代碼:

$('#theform #formProgress').html('<img src="/images/ajax-loader.gif" /> Saving&hellip;'); 

ajax-loader.gifwebapp/public/images文件夾中。

但圖像未加載。請幫幫我。

謝謝!

+0

我應該提到公衆也?謝謝! – user1016403

+0

你的JS文件,爲什麼你的圖片不? –

回答

1

自己的文字回答的問題是:你使用了錯誤的文件路徑:

$('#theform #formProgress').html('<img src="/public/images/ajax-loader.gif" /> Saving&hellip;'); 

如果圖像是/public/images,爲什麼要試圖從/images加載它?

1

你的form.js在哪裏?如果是public/js目錄內和圖像內public/images,那麼你只需要編寫:

$('#theform #formProgress').html('<img src="../images/ajax-loader.gif" /> Saving&hellip;');