Ajax requests doens´t work
Hi.
I am trying to create a ajax based menu using jquery.
After the user clicks in the link the content should load inside a div.
I have tried many ways but the clicked page keeps loading in a new window.
Here is my Jquery code (I have also tried with $.ajax and $.post)
-
$(document).ready(function(){
$("a").click(function(){
var link=$(this).attr('href');
$("#content").load(link);
});
});
Menu:
-
<div id="menu"
<li><a class="pages" href="news.php"><img src="imagens/news_icon.png"/></a></li></div>
In the php page i am just making an echo of some text.
PS: the link variable in Jquery is getting the correct value so the problem is in the ajax call.
Firebug doesn´t give any errors.
Anyone can help me?.