簡體   English   中英

jQuery庫升級到版本1.10后,代碼停止工作

[英]code stopped working after upgrading jquery library to version 1.10

當用戶單擊頁面上的鏈接/按鈕時,我正在使用下面的jquery代碼來顯示loading.gif。

<div class="progress-indicator">
  <img src="/myapplication/images/loading.gif" alt=""  />
</div>


<script>
  $j(window).bind(
           $j.browser.opera ? 'unload' : 'beforeunload',
           function(){
              //display image container
              $j('.progress-indicator').css( 'display', 'block' );
              //set a little timeout and force re-displaying of the image
              //this can work around IE behavior, that 'freezes'
              //animations during a submit
              setTimeout( function() {
                  $j('.progress-indicator > img').attr( 'src',
                  $j('.progress-indicator > img').attr('src')+'?reload' );
              }, 50 );
            } );
</script>

直到我將jquery升級到版本1.10.0之前,它與'jquery version 1.5.1'一起工作都很棒。 該代碼不再起作用。

有人可以幫我嗎? 非常感謝您的所有幫助和建議。

.browser()在jQuery 1.9中已刪除

http://api.jquery.com/jQuery.browser/

升級時,您應該使用jQuery Migrate插件來檢查腳本。

http://jquery.com/upgrade-guide/1.9/#jquery-migrate-plugin

這是升級指南

1http//jquery.com/upgrade-guide/1.9/遷移插件

嘗試尋找問題

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM