I have my regular php page, and it has a div. What I want to happen is when you click a link, the content inside the div is refreshed (the content gets reloaded). If I have the link outside of the div (on the php page), the refresh link works fine. But if I put the link inside the div (so it's part of the loaded content) it doesn't work. I'm using jQuery so my refresh link looks like this..
<a href="" id="refreshpage">refresh</a>
The actual script is like
$("#refreshpage").click(function(){
$("#box").html('<p>loading..</p>');
$.get("page", function(loadthis){
$("#box").html(loadthis);
});
return false;
});
Why doesn't the link work when it's part of the loaded content? Is it only because I'm using jQuery?