我有以下代码在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中发生这种情况的任何想法?
答案 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){
}
});
});