看着我的錯誤日誌,似乎你仍然引用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');
}
});
}
哦,你的權利,我使用firef開發這個網站ox firebug console.log()有一個函數,但在chrome中,沒有這樣的函數console.log。非常感謝你。我的腳本現在正常工作 – GusDeCooL 2010-10-28 05:17:38
@Gusde爲什麼console.log在chrome中拋出錯誤,對我來說它的工作也在chrome中。去鉻開發工具欄,你可以看到它們 – kobe 2010-10-28 06:21:16