The code I have loads a php page, but it only works if I use a button. I need it to work with a link <a href=""></a> <html> <head> <title>Ajax with jQuery Example</title> <script src="http://code.jquery.com/jquery-latest.min.js"></script> <script type="text/JavaScript"> $(document).ready(function(){ $("a").click(function(){ $("#quote p").load("index.php"); }); }); </script> <style type="text/css"> #wrapper { width: 240px; height: 80px; margin: auto; padding: 10px; margin-top: 10px; border: 1px solid black; text-align: center; } </style> </head> <body> <div id="wrapper"> <div id="quote"><p> </p></div> <input type="submit" id="generate" value="Generate!"> <a href="" id="">click</a> </div> </body> </html>
Hi petschephp, The only thing you need is to prevent default when link is clicked or simply return false: /* your code here ........................... */ $("a").click(function(){ $("#quote p").load("index.php"); return false; }); /* your code here ........................... */ HTML: Regards