So basically I am using jQuery post to do an ajax call to an external php page and then I echo out the result, and then display it on the actual page.
The problem is, whenever the external php page returns some javascript, it's not being displayed on the actual page.
Javascript being returned
<script type="text/javascript">z_media = "SQgeKL07Nr"; z_autoplay=false; z_width=899; z_height=506;</script><script type="text/javascript" src="http://www.zunux.com/static/js/embed.js"></script>
My jQuery
function videoGrabber(mirror_id, video_version, firstVideo_version, videoNumber) {
jQuery.post("/path/to/my/external/php/file.php", {firstParam : mirror_id, secondParam : video_version, thirdParam : firstVideo_version}, function(data) {
//this is your response data from serv
console.log(data);
jQuery('#videoContainer').html(data);
});
return false;
}
Now generally, when iframes are being returned, they are showing perfectly fine in the #videoContainer id, however, whenever that javascript embed code is being returned, it's not displaying anything in the #videoContainer id. But I can definitely confirm that the external php page is returning the data since I can see it in the console. So, how can I fix this?
console.log(data)..?#videoContainer? Your JS script just has a few variables... there is no visible content and nothing that calls a JS function.