Friday, April 20, 2012

how to load the Jquery response(HTML page with script tags) into the DOM

$.get('/web/guest/reports',function(data){
alert(data);
$('div #returnData').html(data);
});


Here i am making a request to the reports page through jquery get and in the callback function the jquery get response date ie the variable 'data' is html page with script tags in it. When i alert that i am able to see the whole html page response. After inserting the data into DOM ie div with id returnData ...The scripts are not available in the DOM..



Actually i have the requirement that i have to load the page and then run the script functions that are there in that page. But those script functions are getting added to the DOM..



please post the code snippet for solving the issue and requirement..





No comments:

Post a Comment