I've got a problem. this is what I have on my page somewhere in header
$(document).ready(function(){
$(".ajax").click(function(e){
var url = $(this).attr("href");
var url = url.split("##/");
if (!url[1]){url[1]=" ";}
var page = "http://<?php echo $_SERVER[SERVER_NAME]; ?>page.php?ajax=1&what="+url[0]+url[1];
$("#content").load(page);
var kkk = 'Asdasdasd';
});
});
so, after clicking on <a href="##/new_page" class="ajax">new</a>
, content is being filled with this:
<script> alert(kkk); </script>
<a href="##/old_page" class="ajax">old page</a>
However, alert is not taking in consideration as new page DOES NOT see kkk and neither link which worked on the original page works. Why?