⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 searchresults.html

📁 站内文本搜索Java小程序 SearchToHTML applet小程序可以让你对指定的若干文件进行文本搜索
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title>Search Results</title>

<!--This script and the accompanying class files making up the
SearchToHTML applet are copyright 1999 David Faden for The Gilbert Post.
They are distributed as linkware; so long as you include a prominent link
to The Gilbert Post http://www.geocities.com/Athens/Parthenon/1911/
(already included with source), they are free to use.  Redistributions should
include this notice as should modified versions. Thank you.-->
<!--The matches are encoded in a query string-->
<!--The query string has the following format (each entry is encoded so that it can
be transferred safely through the URL) :
"?"+[searchwords]+","+["y" if exact, else "n"]+["y" if HTML excluded, else "n"]+
[(match) [file name]+":"+[title]+":"+[anchor]+":"+[doc info]+":"+[match context]]+","...etc.

or in other words:

"?" (searchPhrase) "," ("y" | "n") ("y" | "n") ((matchURI) ":" (anchor)? ":" 
(documentInfo)? ":" (matchContext) ",")*
-->

<script language="JavaScript">
<!--
//This script is not especially fault tolerant.
//If you improve on this script, please send the source code
//to gilbertnews@hotmail.com so I can see what you've done
//and incorporate it into the main releases.

//Text used in search results messages:
var noData_txt = "No search data were provided";
var yourSearch_txt = "Your search for";
var exactMatches_txt = "with exact matches only";
var excludingHTML_txt = "excluding HTML";
var yielded_txt = "yielded";
var closestAnchor_txt = "Closest anchor";
var docInfo_txt = "Document Info";
var context_txt = "Match Context";
var noMatches_txt = "No matches";

//Which elements should be displayed along with the results?
var displayAnchor = true;
var displayDocInfo = true;
var displayContext = true;
//If you do not want to display the context (you set displayContext to false),
//you should also set the applet parameters leadingcontextlength and 
//trailingcontextlength to zero to conserve memory.

function writeResults() {
  var estr=this.location.toString();
  var index=estr.indexOf("?");
  if (index == -1) {
    document.writeln("<em>" + noData_txt + "</em>");
    return;
  }
  index++;
  estr=estr.substring(index,estr.length);
  index=estr.indexOf(",");
  document.writeln("<dl>");
  document.write("<dt>" + yourSearch_txt + " <b>"+unescape(estr.substring(0,index))+"</b> ");
  estr=estr.substring(index+1,estr.length);
  if (estr.substring(0,1) == "y") 
    document.write(" (" + exactMatches_txt + ") ");
  if (estr.substring(1,2) == "y") 
    document.write(" (" + excludingHTML_txt + ") "); 
  document.writeln(yielded_txt + ":<p>");
  estr=estr.substring(2, estr.length);
  index=-1;
  var numOfMatches = 0;
  var lastindex=0;//colon
  var clastindex=0;//comma
  var currdata="";
  var myurl="";
  var myanchor="";
  var colonindex=-1;
  var info="";
  var context="";
  var anchor="";
  while ((index=estr.indexOf(",",index+1)) != -1) {
    currdata=estr.substring(clastindex,index);
    clastindex=index+1;
    colonindex=currdata.indexOf(":");
    if (colonindex != -1) {
        numOfMatches++;
        
      //Get the URL
      myurl=unescape(currdata.substring(0,colonindex));
      
      //Get the page's title
      lastindex=colonindex+1;
      colonindex=currdata.indexOf(":",lastindex);
      document.write("<dd><a href=\""+myurl+"\"><b>" +
            unescape(currdata.substring(lastindex,colonindex)) + 
            "</b> <b>("+myurl+")</b></a>");

      //Get the anchor
      lastindex=colonindex+1;
      colonindex=currdata.indexOf(":",lastindex);
      anchor=unescape(currdata.substring(lastindex,colonindex));
      if (anchor.length > 0 && displayAnchor) 
        document.write(" <a href=\""+myurl+"#"+anchor+"\">[" + closestAnchor_txt +"]</a>");
      document.writeln("<br>");
      
      //Get document info
      lastindex=colonindex+1;
      colonindex=currdata.indexOf(":", lastindex);
      info=unescape(currdata.substring(lastindex,colonindex));
      document.write("<small>");
      if (info.length > 0 && displayDocInfo) 
        document.write("<b>" + docInfo_txt + "</b>: "+info+"&nbsp;&nbsp;&nbsp;&nbsp;");
        
      //Get the match context
      lastindex=colonindex+1;
      context=unescape(currdata.substring(lastindex,currdata.length));
      if (context.length > 0 && displayContext) 
          document.writeln("<b>" + context_txt + "</b>: \""+context+"\"");
      document.write("</small>");
      document.write("<p>");
    }
  }
  if (numOfMatches == 0)
    document.writeln("<em>&lt;" + noMatches_txt + "&gt;</em>");
  document.writeln("</dl>");
}


//-->
</script>
</head>
<body>
<div align="center">
<h1>Search Results</h1>
<hr>
</div>
<script language="JavaScript">
<!--
  writeResults();
//-->
</script>
<noscript>
This feature requires JavaScript.
</noscript>
<!-- This file, the Java source files, and the accompanying binaries and examples
     are distributed as linkware for The Gilbert Post. If you do not have a link to The 
     Gilbert Post http://www.geocities.com/gilbertnews/ on an accessible page of the
     site making use of SearchToHTML, then you are violating the 
     linkware agreement. -->
<hr>
The SearchToHTML applet/script is distributed as <a href="http://www.geocities.com/Athens/Parthenon/1911/linkware/" target="_top">linkware</a> for <a href="http://www.geocities.com/Athens/Parthenon/1911/" target="_top">The Gilbert Post</a>, an independent h.s. student paper. Visit our pages and listen and learn Spanish phrases, play games in the arcade, explore a fractal, learn about the lives of U.S. Presidents, or explore our site with the <a href="http://www.geocities.com/Athens/Parthenon/1911/sitemap.html" target="_top">AdvSiteSearcher applet</a> (also available as linkware).
<p>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -