Using JQuery to Access a New Window's DOM

前端 未结 3 1377
忘掉有多难
忘掉有多难 2020-12-03 21:11

I am creating a new window that will contain text that user will print. I would like to do something similar to this:

var new_win = window.open();
$(new_win.         


        
3条回答
  •  既然无缘
    2020-12-03 21:46

    To open popup window and modify it's content you can use this code

    var popup = window.open('/' + window.URL_PREFIX + 'print/', '_blank');
    
    popup.onload = function() {
        $(popup.document.body).html('hello');
    };
    

提交回复
热议问题