2011-10-28 146 views
0

我試圖更新表單並在提交表單時插入gif加載圖像。我正在使用的應用程序是在Sharepoint中構建的,使用jQuery和AJAX。 IE中沒有顯示gif圖像。它可以在所有其他瀏覽器中正常工作。當我刪除我的提交功能時,我只能讓圖像出現在IE中。我的代碼如下。任何想法可能會發生在這裏?謝謝。在IE8中未顯示Gif

形式:

<div class='reply'> 
//loader image 
<div class='loader_gif'> 
<img src='http://somesite.com/chat-zone/PublishingImages/loader.gif' /> 
</div> 
//submit button 
<a href='javascript: submitToCommentForm(" + QuestionID + ", " + ID + ");'> 
<img src='/chat-zone/PublishingImages/reply.jpg' /></a> 
</div> 

的div.loader_gif被設置爲顯示:無。這裏是呼籲提交功能:

function submitToCommentForm(commentID, articleID) { 
//Show the loader 
$('div.loader_gif').css('display','block'); 
//Check that comment is valid and submit 
    var title = $('div#questionscommentsForm-'+ commentID + ' TEXTAREA#replytext-'+ commentID).val(); 
    if (title == '' || title == 'Comment') { 
     $('.invalidmesssagecomment').show(); 
     $('div#questionscommentsForm-'+ commentID + ' TEXTAREA#replytext-'+ commentID).focus(); 
    } else { 
     // Run the create new comment function 
     CreateNewthereadedcomment(commentID,title); 
     updateCount(ArticleID); 
    } 
} 
+0

嘗試用'addClass'和'removeClass',或用'$嘗試( 'loader_gif')' –

回答