narjis Posted December 10, 2011 Share Posted December 10, 2011 Hi, I'm trying to load my linked pages to href in the container div and here is the code. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Prac </title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <script type="text/javascript" > $("#navigation a").click(function(){ var page = $(this).attr('href'); $("#container").load(page); return false; }); </script> </head> <body> <div id="navigation"> <a href="home.html" onclick="return false;" >Home</a><br /> <a href="about.html" onclick="return false;">About</a><br /> <a href="contact.html" onclick="return false;">Contact</a><br /> </div> <div id="container" style="width: 500px; height: 300px; background-color:#FF9;"></div> </body> </html> It is not working properly. Please Help. Link to comment https://forums.phpfreaks.com/topic/252866-help-required/ Share on other sites More sharing options...
sunfighter Posted December 10, 2011 Share Posted December 10, 2011 onclick="return false;" Not needed <div id="navigation"> <a href="home.html">Home</a><br /> <a href="about.html">About</a><br /> <a href="contact.html">Contact</a><br /> </div> Link to comment https://forums.phpfreaks.com/topic/252866-help-required/#findComment-1296538 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.