IE jQuery ajax导致堆栈溢出

时间:2010-01-06 21:23:14

标签: jquery internet-explorer

我有以下代码在IE中给我一个jQuery中的错误“open(G,M.url,M.async”

$("#submitButton").click(function(){            
    $.ajax({
        type: "POST",
        url: "http://url.com/postChat.php",
        data: "comment="+$("#userInput").val(),
        success: function(msg){

        }
    });             
}); 

关于为什么会在IE中发生这种情况的任何想法?

3 个答案:

答案 0 :(得分:0)

尝试将return false;放在点击处理程序的末尾。

答案 1 :(得分:0)

此代码是否多次运行?如果要将5000个单击处理程序绑定到同一个元素,您肯定会看到堆栈溢出。

答案 2 :(得分:0)

不应该是:

$("#submitButton").click(function(){            
    $.ajax({
        type: "POST",
        url: "http://url.com/postChat.php",
        data: { 'comment': $("#userInput").val() },
        success: function(msg){

        }
    });             
}); 
相关问题