this is my first jquery code.Here i am trying to do a content loading mechanism using jquery ajax. It supposed to load content in a container div.But it is navigating me to a whole new page.I want that the 'a' tag does not navigate me to another page.What i am doing wrong here ?How i can achieve that?
<html>
<body>
<ul>
<li><a href='about.html'>about</a></li>
<li><a href='faq.html'>faq</a></li>
</ul>
<div id='content'></div>
<script src='c/xampp/htdocs/practice/jquery/jquery.js'></script>
<script>
$('a').click(function(){
var page=$(this).attr('href');
$('#content').load(page);
return false;
});
</script>
</body>
</html>
c/xampp/htdocs/practice/jquery/jquery.jsshould bec:/xampp/htdocs/practice/jquery/jquery.jsassuming you are on a windows machine