this problem is so weird.
i have used jquery to link a specific id to an alert(“hello”).
$("#submit_reply").live("click", function() {
event.preventDefault();
alert("hellooooo");
});
now in safari when i click it works. but when im using firefox its not working. the submit_reply (a submit button) refreshes the whole page. that is to say, jquery wasnt able to bind it.
how can i debug this problem? firefox shows nothing wrong in console. but why did it work in safari? what tools can i use to check what the problem is…help!
You are not passing in the
eventobject to the function.Try this:
Or this:
As long as
e.preventDefault()orreturn false;are executed before the end of the function, you’re good to go.