Following is the jquery code I am using to add a script file to a link opened via document.open
method but it is not adding to the url
$(document).ready(function(){
$('button').on('click',function(){
var myid = $(this).attr('id');
var url = "http://mysite.com/"+ myid +"/index.html";
window.open(url,"_blank","toolbar=yes, location=yes, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=no, copyhistory=yes, width=400, height=400");
var s = document.createElement("script");
s.type = "text/javascript";
s.src = "http://mysite.com/apiwrapper.js";
$("head").append(s);
})
})
I need to add http://mysite.com/apiwrapper.js
to my url
i.e. opened via window.open
method