Running Javascript in new window.open

前端 未结 4 1926
执念已碎
执念已碎 2020-12-01 22:10

I\'m running this function to open a new window.

function htmlNewWindow(id) {
    var html = $(id).html();
    var newWindow = window.open(\'\');
    newWind         


        
4条回答
  •  温柔的废话
    2020-12-01 22:30

    Try this:

    var newWindow = window.open('');
    newWindow.document.createElement('script');
    script.src = 'js/myScript.js';
    newWindow.document.head.appendChild(script);
    

提交回复
热议问题