javascript - jquery: firefox cant find id tag but safari can? -


This problem is so weird.

I used jquery to link a specific ID to a warning ("hello").

  $ ("# submit_reply"). Live ("click", function () {event.preventDefault (); warning ("hellooooo");});  

Now in Safari when I click it works but when it is not using Firefox, Submit_reply (a submit button) refreshes the whole page to say , Jquery was not able to bind it.

How can I debug this problem? Nothing in the Firefox console shows the wrong but why did it work in Safari?

You are not going into an object in the Event function.

Try it:

  $ ("#submit_reply") .live ('click', function (E) {e.preventDefault (); Alert ('hello' );});  

or this:

  $ ("#submit_reply") .live ('click', function () {warning ('hello'); return false; } );  

Unless e.preventDefault () or return false; is executed before the end of the function, you are good to go


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -