2014-09-26 98 views
0

我有簡單的jQuery代碼和「顯示警報」按鈕我的網頁JavaScript警告正常工作的Firefox,但不是在Chrome和瀏覽器

當我點擊「顯示警報」按鈕;頁面的所有設計都是扭曲的。 它通常工作在Firefox,但不在Chrome和Explorer中。

plaese參考鏈接的問題:http://bit.ly/1vnHPU2

$(function() { 

     $("#buttonAlert").click(function() 
      { 
      alert('button clicked'); 
      } 
    ); 
}); 

編輯:

我清理腳本BLOKS的所有點擊功能頁。但問題並非如此。

謝謝!

+1

它似乎適用於我在所有瀏覽器。 – 2014-09-26 17:14:37

+0

它應該是'$(「#buttonAlert」)。click(function()'right ??? – Lal 2014-09-26 17:15:55

+0

什麼是你的chrome和ie版本? – Developer 2014-09-26 17:18:16

回答

1

添加標籤按鈕類型

<button class="btn btn-primary btn-block" id="buttonAlert" name="buttonAlert" > Show Alert </button> 

<button type="button" class="btn btn-primary btn-block" id="buttonAlert" name="buttonAlert" > Show Alert </button> 

當我sloved到問題感謝所有的朋友對這個問題感興趣。

0
$(function() { 

     $("#buttonAlert").on("click", function() 
      { 
      alert('button clicked'); 
      } 
    ); 
}); 

嘗試的是,有時我有問題,只有 「點擊()」

+0

我試過但重複同樣的問題 – Progy 2014-09-26 17:24:12

+0

該按鈕觸發了一些東西否則,看看是否有其他東西在調用#buttonAlert – Bioto 2014-09-26 17:26:16

+0

'on(「click」...)'和'click(...)'會產生同樣的結果 – epascarello 2014-09-26 17:28:54

相關問題