I am trying to add ajax to WordPress using jquery-ajaxy plugin and I am stuck in one:
My page is loaded with ajax call, filtered and added to dom. In short, it will 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, but there are built-in js scripts in $ mainContent that alternate jQuery. I need them somehow.
Everything works if I just do
.append(data);
But the data contains the full html (doctype, head, meta), which I cannot add. So, is there a way to make these tags work after .find()?
source
share