home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2000 September / PCpro_2000_09.ISO / webdesign / training / kakao / tips / result.js < prev    next >
Encoding:
Text File  |  1999-02-20  |  2.3 KB  |  69 lines

  1. var loc = unescape(parent.frames[1].store);
  2. var end = loc.indexOf("&");
  3. if (end == -1) end = loc.length;
  4. var query = loc.substring(1,end);
  5. var results = 0;
  6.  
  7. document.write("<CENTER><H3>Your search for \"" + query + "\" produced:</H3></CENTER><BLOCKQUOTE>");
  8.  
  9. function displayNext() {
  10.  
  11.         loc = loc.substring(1,loc.length);
  12.         var end = loc.indexOf("&");
  13.         if (end == -1) {
  14.                 url = loc.substring(0,loc.indexOf("+"));
  15.                 keyword = loc.substring((loc.indexOf("+")+1),loc.length);
  16.                 test = loc.substring(2,loc.indexOf("+"));
  17.                 document.write("<TABLE><TR><TD>"+ results + ". " + keyword + " . " +</TD><TD><A HREF=\"" + url + "\">" + url + "</A></TD></TR>");
  18.         }
  19.         else {
  20.                 url = loc.substring(0,loc.indexOf("+"));
  21.                 keyword = loc.substring((loc.indexOf("+")+1),end);
  22.                 test = loc.substring(2,loc.indexOf("+"));
  23.                 loc = loc.substring(end,loc.length);
  24.                 document.write("<TR><TD>"+ results + ". " + keyword + " . " + test + "</TD><TD><A HREF=\"" + url + "\">" + url + "</A></TD></TR>");
  25.                 results++;
  26.                 displayNext();
  27.         }
  28. }
  29.  
  30. if (loc.indexOf("&") == -1) document.write("</OL><CENTER>Fⁿr diesen Suchbegriff wurde kein Eintrag gefunden!");
  31. else {
  32.         loc = loc.substring(loc.indexOf("&"),loc.length);
  33.         document.write("<CENTER><TABLE BORDER=0 CELLPADDING=10><OL><TR><TD ALIGN=CENTER><B>Keyword</B></TD><TD ALIGN=CENTER><B>URL</B></TD></TR>");
  34.         results++;
  35.         displayNext();
  36.         document.write("</OL></TABLE><P><CENTER><H3>" + results + " Match");
  37.         if (results != 1) document.write("es");
  38.         document.write("</H3>");
  39. }
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52. <FORM NAME="form">
  53. <input type="text" name="query" size=20 maxlength=256>
  54. <A HREF="javascript:processSearch()" onMouseover="window.status='Click this button to start the search'; return true"> </A>
  55. <input type="button" value="Start Search" onClick="processSearch();">
  56. </FORM>
  57.  
  58. <SCRIPT LANGUAGE="JavaScript">
  59. <!--
  60.  
  61. temp = document.location + "";
  62. if (temp.indexOf("=") != -1) {
  63.         temp = temp.substring((temp.indexOf("=")+1),temp.length);
  64.         document.form.query.value = temp;
  65.         processSearch();
  66. }
  67.  
  68. //-->
  69. </SCRIPT>