jeudi 1 février 2018

window.open + embedding JS into page?

I'm really new to coding. Using JavaScript, I'm trying to open a webpage and embed JavaScript into the opened webpage.

var popup = window.open("http://x.x.x.x.");
popup.document.open();
popup.document.write('<script src="http://x.x.x.x/file.js" type="text/javascript"></script>');
popup.document.close();

But of course this doesn't work and I'm not sure why. Would anyone be willing to recommend advice or a solution?




Aucun commentaire:

Enregistrer un commentaire