»
AnglaisFrançaisVietnamien

Imprimer - Ouvrir les liens dans une nouvelle fenêtre de script - JavaScriptBank.com

Version complète: jsB@nk » Browser » Window » Ouvrir les liens dans une nouvelle fenêtre de script
URL: https://www.javascriptbank.com/open-links-in-new-window-script.html

Ouvrir les liens dans une nouvelle fenêtre de script © JavaScriptBank.comAjouter la possibilité d'autoriser Liens sur votre page d'être ouvert dans de nouvelles fenêtre avec ce puissant script. Un simple checkbox permet de basculer entre le courant et la nouvelle fenêtre. C'est un script qui fonctionne croix navigateur.

Version complète: jsB@nk » Browser » Window » Ouvrir les liens dans une nouvelle fenêtre de script
URL: https://www.javascriptbank.com/open-links-in-new-window-script.html



JavaScript
<SCRIPT type="text/javascript"><!--/* Open links in new window Script- By spk100 (spk100@yahoo.com) * Script featured on/available at Dynamic Drive- http://www.dynamicdrive.com/ * Modified by jsB@nk.com. This notice must stay intact for use *///Enter "_blank" for new window (each time), "window2" for a set secondary windowvar newwindow="_blank"function hyperlinks(target){   if (target) where = newwindow;   else where = "_self";   for (var i=0; i<=(document.links.length-1); i++){ var linkobj=document.links[i].href   if ( linkobj.indexOf("javascript:") ==-1 && linkobj.indexOf("#") ==-1){   if (target && where!="_blank") //DynamicDrive.com added routine- open window in set secondary window      document.links[i].onclick=function(){if (window.window2 && !window2.closed)window2.location=this.hrefelse        window2=window.open(this.href)window2.focus()      return false      }   else{      if (newwindow=="window2") document.links[i].onclick = "";          document.links[i].target = where;       }   }}}function inithyperlinks(){    //DynamicDrive.com added routineif (document.targetform.targetnew.checked)hyperlinks(true)}window.onload=inithyperlinks// --></SCRIPT><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<FORM name="targetform">  <INPUT TYPE="checkbox" NAME="targetnew" ONCLICK="hyperlinks(this.checked)" checked value="ON"><b>Open new window when click links</b><br><a href="http://javascriptbank.com">JavaScriptBank.com</a><br><a href="http://tructuyen.org">TrucTuyen.org</a></form><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->