我正在使用表單向創建圖像的頁面提交詳細信息,表單使用Jquery提交,以便用戶不必離開頁面。 send()函數調用refresh()函數來更新放置圖像的div ...jquery get image
我遇到了一個代碼行問題,我不知道放什麼來得到它的工作:
function refresh()
{
$(function() {
var img = new Image();
$(img).load(function() {
//$(this).css('display', 'none'); // .hide() doesn't work in Safari when the element isn't on the DOM already
$(this).hide();
$('#loader').removeClass('loading').append(this);
$(this).fadeIn();
}).error(function() {
// notify the user that the image could not be loaded
// The next line causes the error
}).attr('src', "signatures/" +$("#username") "png");
});
}
任何幫助,將不勝感激。
有什麼錯誤? – scottm