javascript - Ad call response in ajax success contains document.write -


we want load ad after ajax load more. ad call response contains document.write , redirecting ad after call made. there no method ad html , append it. must deal document.write in ajax success. saw iframe don't know how should implement it.

$.ajax({      .      .       .      success: function( response ) {         var loadedad = ad call here; -- redirects ad due document.write in ad response. 

thanks.

sending ajax request iframe context should trick, or @ least can parse ad result code replace document.write calls dom related functions.

example using iframe context evaluate ajax response:

var adcode = "document.write('example')",     iframe = document.getelementbyid('myframe');  iframe.contentwindow.eval(adcode); 

Comments