2010-08-14 100 views

回答

2

的問題是,在那裏你在Firefox中使用它form沒有定義,你可以寫有點不同的是跨瀏覽器這樣的兼容:

function get() { 
    $('#dare').fadeOut(500); 

    $.post ('data.php', $("form").serialize(), function(output) { 
    $('#dare').html(output).fadeIn(500); 
    }); 
} 

.serialize()功能將採取一切在形式的序列化,導致所有其他瀏覽器都作出同樣的請求......少了很多代碼:)輸入元素

+0

非常有效,謝謝! – Sebastian 2010-08-14 10:40:22

0

在Firebug檢查錯誤消息:

form is not defined 

$.post ('data.php', {name: form.name.value, mode: mode, player: player}, 
0

,當你在Firefox瀏覽該網站時,會生成以下錯誤:

Error: form is not defined
Source File: http://saucydares.freehostia.com/saucy.php
Line: 29

有問題的行是

$.post ('data.php', {name: form.name.value, mode: mode, player: player}, 

我覺得你在做什麼這裏的正確方法(如果我解釋你在這裏做的是正確的)是用jQuery獲取表單的名字。