javascript - Dynamic page load can't load Java with page -


i have tried load html element , works ways problem trying load , run included script tag in page. ideas or tutorials would great.

jquery script:

var default_content="";

$(document).ready(function(){

checkurl(); $('ul li a').click(function (e){          checkurl(this.hash);  });  //filling in default content default_content = $('#maincontent').html();   setinterval("checkurl()",250); 

});

var lasturl="";

function checkurl(hash) { if(!hash) hash=window.location.hash;

if(hash != lasturl) {     lasturl=hash;        if(hash=="")     $('#maincontent').html(default_content);      else     loadpage(hash); } 

}

function loadpage(url) { url=url.replace('#page','');

$('#loading').css('visibility','visible');  $.ajax({     type: "post",     url: "load_page.php",     data: 'page='+url,     datatype: "html",     success: function(msg){          if(parseint(msg)!=0)         {             $('#maincontent').html(msg);             $('#loading').css('visibility','hidden');         }     }  }); 

}

this routs way of small php file shows pages live. scripts brought in html way not execute. on page have toggle script moves elements , not execute "on click". curent thinking use $.getscripts() must external work , may not exicute.

since there no code... have tried putting script tag @ bottom of document (therefore letting load)?

edit: sorry have commented don't have enough reputation yet. avoid answers in future


Comments