2010-10-28 36 views
1

這是我的網站,我發展http://alessandro.babonmultimedia.com/當我們點擊了接觸(在頂部導航),會有聯繫表格通過jQuery AJAX加載,爲什麼我的AJAX與我們聯繫谷歌瀏覽器不工作

的問題是:

  1. 當我們點擊提交時,它會發送郵件。

這是工作在Firefox 3.6.1,但在谷歌瀏覽器7.0.517.41提交按鈕做什麼..

  1. 爲什麼能發生嗎?
  2. 有沒有辦法讓它工作?
  3. 什麼是實現AJAX JavaScript的最佳方法,當我們選擇的目標是通過JavaScript加載(我首先使用$(document).ready(),但是這對於通過AJAX加載的內容不起作用:()

THX ..

回答

1

看着我的錯誤日誌,似乎你仍然引用console。如果控制檯未打開,然後window.console是不確定的,將停止執行。

function contact_us(){ 
    /**************REMOVE*******************/ 
    console.log('AJAXnya start'); 
    /**************THIS*******************/ 
    $('#contactus form').fadeTo('slow', .2); 
    $.ajax({ 
     type : 'POST', 
     url : '/wp-content/themes/second-edition/js/form-contactus.php', 
     dataType : 'json', 
     data : { 
      name  : $('#contactus input[name="name"]').val(), 
      surname : $('#contactus input[name="surname"]').val(), 
      email : $('#contactus input[name="email"]').val(), 
      website : $('#contactus input[name="website"]').val(), 
      message : $('#contactus textarea[name="message"]').val() 
     }, 
     success : function(data){ 
      alert(data.msg); 
      $('#contactus form').fadeTo('slow', 1); 
     }, 
     error: function(XMLHttpRequest, textStatus, errorThrown){ 
      alert('There Was an Error, please contact Web Administrator'); 
     } 
    }); 
} 
+0

哦,你的權利,我使用firef開發這個網站ox firebug console.log()有一個函數,但在chrome中,沒有這樣的函數console.log。非常感謝你。我的腳本現在正常工作 – GusDeCooL 2010-10-28 05:17:38

+0

@Gusde爲什麼console.log在chrome中拋出錯誤,對我來說它的工作也在chrome中。去鉻開發工具欄,你可以看到它們 – kobe 2010-10-28 06:21:16

相關問題