window.open이 브라우저에 의해 차단된 사용자 정의 알림 효과 코드

1440 단어
현재 점점 더 많은 브라우저들이 팝업 창을 차단하는 기능을 가지고 있다.광고가 튀어나와서 말려도 상관없는데, 만약 고객이 돈을 지불할 때 말려도 함부로 해서는 안 된다.
Gmail의'아이고'는 클래식이지만, 전날 심운은 더 멋진 힌트를 줬다=.브라우저를 켜서 차단한 후 테스트해 보세요. 온라인 리더에서는 코드가 필터를 줄지 안 줄지 모릅니다.코드는 아래에 있지만, 사실 아무런 기술적 함량도 없다.하하...
 
  
window._open=window.open; 
window.open=function(sURL,sName,sFeatures,bReplace){ 
  if(sName==undefined){sName="_blank"}; 
  if(sFeatures==undefined){sFeatures=""}; 
  if(bReplace==undefined){bReplace=false}; 
  var win=window._open(sURL,sName,sFeatures,bReplace); 
  if(!win){ 
    alert(' ! , , ! ~~555~'); 
    return false; 
  } 
  return true; 
}

=.=윈도우를 다시 씁니다.오픈은 이틀 동안 더 좋은 방법을 생각해 내지 못했다. 매개 변수는 하나씩 더하고 네 번째 매개 변수는 백이 돌아가지 않기 위해서인 것 같다. 예를 들어 다음과 같다.
4
 
  

window.open("a.html","a"); 
window.open("b.html","a","",true);
열린 b.html은 후퇴 없이 누르면 됩니다. MSDN에 설명이 있습니다.
Optional. Boolean that specifies whether the sURL creates a new entry or replaces the current entry in the window's history list. This parameter only takes effect if the sURL is loaded into the same window.
true sURL replaces the current document in the history list 
false sURL creates a new entry in the history list.

좋은 웹페이지 즐겨찾기