-1

ユーザーがページ上のリンク/ボタンをクリックしたときに、loading.gif を表示するために次の jquery コードを使用しています。

<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バージョン1.5.1」でうまく機能していました。コードが機能しなくなりました。

誰でも私を助けてもらえますか?ご協力とご提案をいただき、誠にありがとうございます。

4

2 に答える 2

6

.browser()jQuery 1.9 で削除されました

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

アップグレード時にスクリプトをチェックするには、jQuery Migrate プラグインを使用する必要があります。

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

于 2013-09-12T13:41:43.593 に答える
1

アップグレードガイドはこちら

1 : http://jquery.com/upgrade-guide/1.9/および移行プラグイン

問題を探してみてください

于 2013-09-12T13:44:41.770 に答える