1<html>
2 <head>
3 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
4 <script type='text/javascript'>
5 $(document).ready(function() {
6 //option A
7 $("form").submit(function(e){
8 alert('submit intercepted');
9 e.preventDefault(e);
10 });
11 });
12 </script>
13 </head>
14
15 <body>
16 <form action="page_url" method="GET">
17 Search <input type='text' name='q' />
18 <input type='submit'/>
19 </form>
20 </body>
21</html>