[jQuery] Running Javascript from Ajax Response
I am trying to write my first application, and am trying to use jquery to help me along my travels. I have setup my application to work so all pages are loaded via ajax, using anchor's as navigation. However on some pages that i return using the AJAX i want to be able to run code. This works on firefox, however it does not work on anything else. So really my question is: How do i run javascript code from an ajax response? Title: // attach handler to form's submit event alert("Javascript"); $('#myform').submit(function() { // submit the form alert("form submitted"); // return false to prevent normal browser submit and page navigation return false; }); In the above, i only get an alert saying "Javascript" in firefox. Any other browser and it does not work. Please help!
[jQuery] Returning Javascript
I am trying to write my first application, and am trying to use jquery to help me along my travels. I have setup my application to work so all pages are loaded via ajax, using anchor's as navigation. However on some pages that i return using the AJAX i want to be able to run code. This works on firefox, however it does not work on anything else. So really my question is: How do i run javascript code from an ajax response? Title: // attach handler to form's submit event alert("Javascript"); $('#myform').submit(function() { // submit the form alert("form submitted"); // return false to prevent normal browser submit and page navigation return false; }); In the above, i only get an alert saying "Javascript" in firefox. Any other browser and it does not work. Please help!