i have 2 pages, index.php and main.php
Index.php
<!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>Home Ribeirao - Admin</title>
<link href='css/site.css' type='text/css' rel='stylesheet' />
<script src='js/jquery.js' type='text/javascript'></script>
<script src='js/site.js' type='text/javascript'></script>
<script src='js/others.js' type='text/javascript'></script>
</head>
<body>
<div id='logo'>
<img src='logo.png' />
</div>
<div id='wrap'>
<ul>
<li id="item_menu" class='categorias'><a href="#"><p>Categorias</p></a>
</li>
</ul>
<div id='main'>
</div>
</div>
</body>
</html>
main.php
<ul>
<li id="item_menu" class='test'><a href="#"><p>test</p></a>
</li>
</ul>
and my JS code
(function($) {
$(document).ready(function(){
$(".categorias").click( function()
{
loading();
$.ajax({url: "main.php" ,cache:false, success: function(result)
{
$("#main").html(result);
}});
});
$(".test").click( function()
{
loading();
$.ajax({url: "test.php" ,cache:false, success: function(result)
{
$("#main").html(result);
}});
});
})(jQuery);
My problem is:
when i click CATEGORIAS on index, it loads the main.php on #main div very well, but if i click on test, the link does not work, what is going on? test.php is just a page with an echo TEST.
the only way i found to make the TEST works is adding header to the page and reloading the JS files. but if you click like 20 times on the link the page start loading slower, and slower each time you click on it.
This post has been edited by el_pancho: 07 August 2012 - 12:12 PM

New Topic/Question
Reply



MultiQuote




|