Hi
ich hab ein prob mein such script funktioniert nicht.
http://www.self-help.de.vu
wenn ihr den Link "Suche" klickt im menü könnt ihrs selbst ausprobiern. gebt einfach das wort Japan ein.
ich will dass wenn es etwas findet und ich dann auf den link dazu klicke dieses fenster in meinem inlineframe öffnet (target="iframe").
Hier das Script von der Suchfunktion (navi.htm):
Code
<HTML>
<HEAD>
<TITLE>ReCon Nav Page</TITLE>
<SCRIPT LANGUAGE="JavaScript" SRC="recon.js">
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
<!--
var divide = new Array(); // Define global variables
var allMatch = new Array();
var anyMatch = new Array();
var urlMatch = new Array();
var indexer = 0;
var all = false;
var count = 0;
var start = 0;
var urlTest = false;
function validate(text) { // Check for search method.
// Make sure the user enters something
var entry = text; // worthwhile. No extra spaces or
if (entry.charAt(0) == "+") { // strings less than 3 characters
entry = entry.substring(1,entry.length);
all = true;
}
if ((entry.substring(0,4) == "url:") && (all == false)) {
entry = entry.substring(5,entry.length);
all = null;
}
while (entry.charAt(0) == ' ') {
entry = entry.substring(1,entry.length);
document.forms[0].query.value = entry;
}
while (entry.charAt(entry.length - 1) == ' ') {
entry = entry.substring(0,entry.length - 1);
document.forms[0].query.value = entry;
}
if (entry.length < 3) {
alert("ReCon does not search strings that small. Elaborate a little.");
document.forms[0].query.focus();
return;
}
convertString(entry);
}
function convertString(reentry) { // Split the valid string into an array
searchArray = reentry.split(" ");
if (all == false) { allowAny(searchArray); return; }
if (all == true) { requireAll(searchArray); return; }
if (all == null) { parseURL(searchArray); return; }
}
function allowAny(t) { // Kick off the search, and compare any word
for (i = 0; i < profiles.length; i++) { // the user entered with each element in the database
var anyConfirmation = true; // The search loops through each search word and
var compareElement = profiles[i].toUpperCase(); // each database element
var refineElement = compareElement.substring(0,compareElement.indexOf('|HTTP'));
for (j = 0; j < t.length; j++) {
var compareString = t[j].toUpperCase();
if (refineElement.indexOf(compareString) != -1 && (anyConfirmation)) { // If a match is found,
anyConfirmation = false; // put the profile and the
anyMatch[indexer] = profiles[i]; // and its corresponding
indexer++; // URL in an array
}
}
}
if (anyMatch.length == 0) { // If no matches are found, print a no match
noMatch(); // HTML document
return;
}
else { formatResults(anyMatch); } // Otherwise, generate a results document
}
function requireAll(t) { // Incite the search, requiring all search terms entered
for (i = 0; i < profiles.length; i++) { // be present in order to qualify matches
var allConfirmation = true;
var allString = profiles[i].toUpperCase();
var refineAllString = allString.substring(0,allString.indexOf('|HTTP'));
for (j = 0; j < t.length; j++) {
var allElement = t[j].toUpperCase();
if (refineAllString.indexOf(allElement) == 2) {
allConfirmation = false;
continue;
}
}
if (allConfirmation) {
allMatch[indexer] = profiles[i];
indexer++;
}
}
if (allMatch.length == 0) {
noMatch();
return;
}
else { formatResults(allMatch); }
}
function parseURL(u) { // Incite the search, looking only in the URL portion of the string
for (i = 0; i < profiles.length; i++) {
var urlConfirmation = true;
var anyURL = profiles[i].toUpperCase();
var refineAnyURL = anyURL.substring(anyURL.indexOf('|HTTP'),anyURL.length);
for (j = 0; j < u.length; j++) {
var urlPart = u[j].toUpperCase();
if (refineAnyURL.indexOf(urlPart) != 2 && (urlConfirmation)) {
urlConfirmation = false;
urlMatch[indexer] = profiles[i];
indexer++;
}
}
}
if (urlMatch.length == 0) {
noMatch();
return;
}
else {
urlTest = true;
formatResults(urlMatch);
}
}
function noMatch() { // Dyanmic HTML page with no results
parent.frames[1].document.clear();
parent.frames[1].document.open();
parent.frames[1].document.writeln("<HTML><HEAD><TITLE>ReCon Results</TITLE></HEAD>");
parent.frames[1].document.writeln("<BODY BGCOLOR=WHITE >");
parent.frames[1].document.writeln("<TABLE WIDTH=450 BORDER=0 ALIGN=CENTER><TR>");
parent.frames[1].document.writeln("<TD VALIGN=TOP><FONT FACE='Arial'size='4'color='RED'>[B]<DL>");
parent.frames[1].document.writeln("<HR NOSHADE WIDTH=445>");
parent.frames[1].document.writeln("'" + document.forms[0].query.value + "' returned no results.");
parent.frames[1].document.writeln("<HR NOSHADE WIDTH=445>");
parent.frames[1].document.writeln("[/B]</TD></TR></TABLE></BODY></HTML>");
parent.frames[1].document.close();
clearOut();
return;
}
function formatResults(passedArray) { // Dynamic HTML with results page
results = passedArray;
parent.frames[1].document.clear();
parent.frames[1].document.open();
parent.frames[1].document.write("<HTML><HEAD><TITLE>ReCon Results</TITLE></HEAD>");
parent.frames[1].document.writeln("<BODY BGCOLOR=WHITE Link=darkcyan Alink=red>");
parent.frames[1].document.writeln("<TABLE WIDTH=450 BORDER=0 ALIGN=CENTER CELLPADDING=3><TR>");
parent.frames[1].document.writeln("<HR NOSHADE WIDTH=445>");
parent.frames[1].document.writeln("<TD VALIGN=TOP><FONT FACE='Arial'>[B]");
parent.frames[1].document.writeln("Search Query: " + parent.frames[0].document.forms[0].query.value + "
");
parent.frames[1].document.writeln("Search Results: "+ results.length + "</FONT>"+ "
");
parent.frames[1].document.writeln("<DL>");
results.sort();
if (urlTest) {
for (i = 0; i < results.length ; i++) {
divide = results[i].split("|"); // Print each URL result as a unit of a definition list
parent.frames[1].document.writeln("<DT>" +"<FONT FACE='Arial' size='2'>"+"[b]"+ "<A HREF='javascript:void(parent.opener.location.href = \"" + divide[2] + "\" )' >" + divide[2] + "[/b]");
parent.frames[1].document.writeln("<DD>" + "[b]" + divide[1] + "
");
}
}
else {
for (i = 0; i < results.length ; i++) {
divide = results[i].split("|"); // Print each profile result as a unit of a definition list
parent.frames[1].document.writeln("<DT>" +"<FONT FACE='Arial' size='2'>"+"[b]"+ "[url='javascript:void(parent.opener.location.href = \'' + divide[2] + '\' )']" + divide[0] + "[/url]"+"[/b]");
parent.frames[1].document.writeln("<DD>" +"[b]" + divide[1] + "
");
}
}
parent.frames[1].document.writeln("</DL>"); // Finish the HTML document
parent.frames[1].document.writeln("[url='javascript: history.go(-1)'][img]back.gif[/img][/url]");
parent.frames[1].document.writeln("<HR NOSHADE WIDTH=445>");
parent.frames[1].document.writeln("</TD></TR></TABLE></BODY></HTML>");
parent.frames[1].document.close();
clearOut();
}
function clearOut() { // Clear the arrays and variables generated from the current search
allMatch.length = 0; anyMatch.length = 0;
urlMatch.length = 0; divide.length = 0;
indexer = 0; all = false; urlTest = false;
document.forms[0].query.select();
}
//-->
</SCRIPT>
</HEAD>
<BODY bgcolor="black" Link="#FFFF00 vLink="maroon" aLink="green" TEXT="white" onLoad="document.forms[0].query.focus();">
<TABLE BORDER="0" ALIGN="CENTER">
<TR>
<TD width="250" >
<FORM NAME="search" onsubmit="validate(document.forms[0].query.value); return false;">
<INPUT TYPE=TEXT NAME="query" SIZE="40">
<INPUT TYPE=HIDDEN NAME="standin" VALUE="">
</FORM>
</TD>
<td valign="top"><font face="Arial" size="3" color="gold">Suchbegriff(e) eingeben... Entertaste</font></td>
</TR>
</TABLE>
</BODY>
</HTML>
Alles anzeigen
Und hier das Script für den Inhalt den es suchen soll (recon.js):
Code
profiles = new Array(
"WetterOnline | aktuelles Wetter, Vorhersagen, Klima, Segelwetter, Schneehöhen und Satellitenbilder.|http://www.wetteronline.de",
"Kleine Suchfibel| Über Suchmaschinen, welche es gibt, wie sie funktionieren und wie man sie benutzt. Tips zur Recherche und zum Anmelden von Seiten.|http://www.suchfibel.de",
"Screen Saver World|Screen Saver World - nach Kategorien geordnete Bildschirmschoner für PCs und Macs.|http://www.geocities.com/SiliconValley/Network/3697/home.html",
"Netplanet| Umfangreiches Lexikon, das über Geschichte, Struktur, Verhaltensregeln und Fachbegriffe des Internets informiert.|http://www.tomorrow.de",
"Muelltonne|Muelltonne.de - Wiederverwertung von E-Müll in Gedichte oder Witze.|http://www.muelltonne.de/",
"Die Kn@rr Familie |Witzig und Humorgeladen! Vorsicht E-Mail! Fragen an Prominente und Produzenten und deren Antworten.|http://knarr.germany.net/",
"Flat Eric|Flat Eric Kultobjekt aus der Levis-Werbung.|http://www.flateric-online.de",
"Bildschirmschoner|Bildschirmschoner.de - in alphabetischer Reihenfolge aufgelistet. TOP!|http://www.bildschirmschoner.de",
"Alles über Willy | Wissenswertes und Witziges zum Penis aus dem Blickwinkel verschiedenster wissenschaftlicher Fachrichtungen.|http://www.willy-online.de",
"Bissiger-hausherr|Japan Bilder|http://www.bissiger-hausherr.de",
"Friggers ges(t)ammelte Werke|Witze, Sprüche, Humor, Jokes in Hülle und Fülle.|http://www.frigger.de"
);
profileMatch = new Array();
Alles anzeigen
bitte helft mir ich weiß nicht was da nicht stimmt und warum das nicht funktioniert