i am Roger Li

使用Bootstrap 出現 (anonymous function) bootstrap.js:156 錯誤

如果你的網站使用Bootstrap 和jQuery,並在Chrome 的javascript console出現:

  1. Uncaught TypeError: Object #has no method 'on' bootstrap.js:156
  2. (anonymous function) bootstrap.js:156
  3. (anonymous function) bootstrap.js:158
    Bootstrap line 156:
    $(document).on('click.alert.data-api', dismiss, Alert.prototype.close)


    因為 .on() 是由 jQuery 1.7 開始出現,可能你現在使用的jQuery lib 太舊了。請改用較新版本。

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *