JavaScript Javascript Popup with Blocking detection
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了JavaScript Javascript Popup with Blocking detection相关的知识,希望对你有一定的参考价值。
function popup(url,ancho,alto,id,extras){
if(navigator.userAgent.indexOf("Mac")>0){ancho=parseInt(ancho)+15;alto=parseInt(alto)+15;}
var left = (screen.availWidth-ancho)/2;
var top = (screen.availHeight-alto)/2;
if(extras!=""){extras=","+extras;};
var ventana = window.open(url,id,'width='+ancho+',height='+alto+',left='+left+',top='+top+',screenX='+left+',screenY='+top+extras);
var bloqueado = "AVISO:\n\nPara ver este contenido es necesario que desactive\nel Bloqueo de Ventanas para este Sitio."
//var bloqueado = "WARNING:\n\nIn order to use this functionality, you need\nto deactivate Popup Blocking."
if(ventana==null || typeof(ventana.document)=="undefined"){ alert(bloqueado) }else{ return ventana; };
}
以上是关于JavaScript Javascript Popup with Blocking detection的主要内容,如果未能解决你的问题,请参考以下文章