I'm trying to add ajax to WordPress by jquery-ajaxy plugin, and I'm stuck with one thing:
My page is loaded by ajax call, filtered, and appended to dom. So in short, it would be:
data = this.state.Response.data; //full html of page returned by ajax
$mainContent = $(data).find("#content"); //we filter out what we need
$('#content_div').append($mainContent); //we display it
Easy for now, but there are inline js scripts in $mainContent, which are striped by jquery.
I need them, somehow.
It all works, if I just do
.append(data);
But data contains full html (doctype, head, meta) which I can't append.
So, is there a way to make those tags work after .find()
?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…