views:

72

answers:

3

I have the following code that in IE gives me an error in jQuery for "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){

        }
    });             
}); 

Any ideas as to why this would happen in IE?

A: 

Try putting return false; at the end of your click handler.

thenduks
Tried it, still the same error.
dave
A: 

Is this code run multiple times? If you were to bind 5000 click handlers to the same element, you'd see the stack overflow for sure.

darkporter
A: 

Shouldn't that be:

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

        }
    });             
}); 
K Prime
thenduks