Eval script elemtents in HTML body response

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
This commit is contained in:
Lukas Reschke 2017-05-10 13:03:15 +02:00
parent b9bcc819bd
commit 93994b1320
No known key found for this signature in database
GPG Key ID: B9F6980CF6E759B1
1 changed files with 7 additions and 0 deletions

View File

@ -32,6 +32,13 @@ $(document).ready(function(){
var body = $('body');
$('head').remove();
body.html(data);
// Eval the script elements in the response
var dom = $(data);
dom.filter('script').each(function() {
eval(this.text || this.textContent || this.innerHTML || '');
});
body.removeAttr('id');
body.attr('id', 'body-settings');
}