JavaScript弹出新窗口的方法

function open_window(url){
  
    var wparams = 'toolbar=0,location=0,directories=0,status=0,menubar=0,';
        wparams += 'scrollbars=0,resizable=0,width=280,height=150';
  
    var window = window.open(url, 'window_name', wparams);
    window.focus();
}
  
  
function create_window(content){
  
    var wparams = 'toolbar=0,location=0,directories=0,status=0,menubar=0,';
        wparams += 'scrollbars=0,resizable=0,width=280,height=150';
  
    var window = window.open('''window_name', wparams);
  
    window.document.open();
    with(window.document){
        write(content);
        write("<br/>");
        write("<a href=\"javascript:self.close();\">Close window</a>");
    }
    window.document.close();
  
    window.focus();


document.write(ResultData.data)   ;


你可能感兴趣的:(JavaScript弹出新窗口的方法)