html - How to stay in the same page when we use jquery load -


this example file:

<html > <head> <script type="text/javascript" src="js/jquery.js"></script> <script> $(document).ready(function() { $('#hr').click(function() { $('#main').load('show.php');  }); }) </script> </head> <body> <div id="hr"></div> <div id="main"></div> </body> </html> 

in show.php file have submit button , when load file in div , when click submit button take me home page , mean div load show.php file disappear, want when click submit button don't want change in page.

you need submit button return false, e.g.:

<input type="submit" onclick="dostuff(); return false;" /> 

Comments

Popular posts from this blog

hibernate - How to load global settings frequently used in application in Java -

python 3.x - Mapping specific letters onto a list of words -

objective c - Ownership modifiers with manual reference counting -