如何将JS添加到通过window.open方法打开的html文件中

时间:2013-08-17 11:47:51

标签: javascript jquery html

以下是我用于将脚本文件添加到通过document.open方法打开的链接的jquery代码,但它没有添加到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);
    })
})

我需要将http://mysite.com/apiwrapper.js添加到url,即通过window.open方法打开

0 个答案:

没有答案