I've got troubles, tried everything but variable always undefined =/
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#show").load("index.php");
});
$(document).on('click', ' a[href]', function (e) {
var a_href = $(this).find('a').attr('href');
alert ("Href is: "+a_href); //just for test
$("#show").load(a_href);
return false;
});
</script>
</head>
<body>
<a href="one.php">One</a>
<br>
<a href="two.php">two</a>
<div id="show"></div>
</body>
</html>
I actually want links to be taken from #show div and replace show div load after it without changing the link or reloading the page, the links are generated in php and always change this is why i cant have static links.
.find('a')