home *** CD-ROM | disk | FTP | other *** search
/ PC User 2005 May / CD / PCU0505CD.iso / software / full / coffecup / files / html2005.exe / %MAINDIR% / Javascript / open-link-option.xml < prev    next >
Encoding:
Text File  |  2005-02-16  |  1.3 KB  |  55 lines

  1.  
  2. <ccresource>
  3.   <cctitle>
  4. Open Link Option Chooser
  5.   </cctitle>
  6.   <cccategory>
  7. Browser
  8.   </cccategory>
  9.   <ccDescription>
  10.     This code will allow the visitor to choose whether or not to open the link in a new browser window or not.
  11.   </ccdescription>
  12.   <ccinstructions>
  13.   The code goes both within the HEAD and BODY tags.  You can change the links to suit your needs.
  14.   </ccinstructions>
  15.   <ccheadcontent>
  16. <SCRIPT LANGUAGE="JavaScript">
  17.  
  18. <!-- Begin
  19. function hyperlinks(target)
  20. {
  21.   if (target) where = "_blank";
  22.   else where = "_self";
  23.   for (var i=0; i<=(document.links.length-1); i++)
  24.   {
  25.   document.links[i].target = where;
  26.   }
  27. }
  28. //  End -->
  29. </script>
  30.   </ccheadcontent>
  31.   <ccbodycontent>
  32.  
  33.  
  34. <div align="center">
  35. <form>
  36. <input type="checkbox" name="targetnew" onclick="hyperlinks(this.checked)"> I want the links to open in a New Window
  37. </form>
  38.  
  39. <a href="http://www.coffeecup.com/">CoffeeCup's Main Site</a><br>
  40. <a href="http://www.coffeecup.com/help">Get some help!</a><br>
  41. <a href="http://www.coffeecup.com/software">Download our entire collection.</a>
  42. </div>
  43.  
  44.   </ccbodycontent>
  45.   <ccelementcontent>
  46.   
  47.    <ccelementname></ccelementname>
  48.    <ccelementaction></ccelementaction>
  49.    
  50.   </ccelementcontent>
  51.   <ccextradata>
  52.  
  53.   </ccextradata>
  54. </ccresource>
  55.