您现在的位置是:首页 > 编程 > 

通过js打开浏览器独立的页面

2025-07-20 19:49:25
兼容Chrome浏览器 window.showModalDialog 是IE浏览器特有的内置方法 window.showModalDialog let has_showModalDialog = !!window.showModalDialog; if(!has_showModalDial

兼容Chrome浏览器
window.showModalDialog 是IE浏览器特有的内置方法
window.showModalDialog

  let has_showModalDialog = !!window.showModalDialog;
      if(!has_showModalDialog &&!!(window.opener)){
          window.οnbefοreunlοad=function(){
              window.opener.hasOpenWindow = false;
          }
      }
  if(window.showModalDialog == undefined){
      window.showModalDialog = function(url,mixedVar,features){
          if(window.hasOpenWindow){
              window.myewWindow.focus();
          }
          window.hasOpenWindow = true;
          if(mixedVar) var mixedVar = mixedVar;
          if(features) var features = features.replace(/(dialog)|(px)/ig,).replace(/;/g,	,	).replace(/\:/g,=);
          let left = (window.screen.width - parseInt(features.match(/width[\s]*=[\s]*([\d])/i)[1]))/2;
          let top = (window.screen.height - parseInt(features.match(/height[\s]*=[\s]*([\d])/i)[1]))/2;
          window.myewWindow = window.open(url,_blank,features);
      }
  }
// image.html 为显示的页面
 window.showModalDialog(`/image.html?src=${this.imageUrl}`, 		, 	dialogWidth:00px;dialogHeight:80px;	);

#感谢您对电脑配置推荐网 - 最新i3 i5 i7组装电脑配置单推荐报价格的认可,转载请说明来源于"电脑配置推荐网 - 最新i3 i5 i7组装电脑配置单推荐报价格

本文地址:http://www.dnpztj.cn/biancheng/1121124.html

相关标签:无
上传时间: 2025-07-18 02:56:13
留言与评论(共有 7 条评论)
本站网友 roselip
14分钟前 发表
本站网友 肾虚食谱
26分钟前 发表
00px;dialogHeight
本站网友 usb无线网卡驱动
18分钟前 发表
dialogWidth
本站网友 dhea
21分钟前 发表
本站网友 鱼鳞病医院
26分钟前 发表
dialogWidth
本站网友 南昌娱乐
26分钟前 发表