home *** CD-ROM | disk | FTP | other *** search
/ Chip 2003 July / CMCD0703.ISO / Software / Freeware / Comunicatii / slim / sbrowser.exe / scripts / ExtractAllLinks.js < prev   
Text File  |  2003-05-05  |  402b  |  16 lines

  1. ExtractAllLinks("*.mp3");
  2. function ExtractAllLinks(sPattern)
  3. {
  4.     var s="";
  5.     var i;
  6.     sPattern=sPattern.replace(/\./g,"\\.");
  7.     sPattern=sPattern.replace(/\*/g,".*");
  8.     sPattern=sPattern.replace(/\?/g,".");
  9.     alert(sPattern);
  10.     var rx=new RegExp(sPattern,"ig");
  11.     for (i=0;i<document.links.length;i++)
  12.     {
  13.         if (document.links[i].href.match(rx)) s=s+document.links[i].href+"\r\n";
  14.     }
  15.     alert(s);
  16. }