Click to See Complete Forum and Search --> : database and javascript


vinsa
07-13-2003, 04:04 AM
Hello!
First sorry for my English.
I found a better search engine.
Can help me to
search in my database with
this search-engine. This search-engine
search in the same page. I want to
search in my database and results to show
in ifframe "middle". I will use this dictionary
on my local computer - not in Internet.
==================
<HTML><HEAD><TITLE>seaching</TITLE>
<META content="text/html; charset=windows-1251" http-equiv=Content-Type>

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
var IE4 = (document.all);

var win = this;
var n = 0;

function findInPage(str) {
var txt, i, found;
if (str == "")
return false;
if (IE4) {
txt = win.document.body.createTextRange();
for (i = 0; i <= n && (found = txt.findText(str)) != false; i++) {
txt.moveStart("character", 1);
txt.moveEnd("textedit");
}
if (found) {
txt.moveStart("character", -1);
txt.findText(str);
txt.select();
txt.scrollIntoView();
n++;
}
else {
if (n > 0) {
n = 0;
findInPage(str);
}
else
alert(str + " was not found on this page.");
}
}
return false;
}
// End -->
</script>

</HEAD>
<BODY>

<!-- Data source object: file parameters -->
<object id="selectlist" width="0" height="0" classid="clsid:333C7BC4-460F-11D0-BC04-0080C7055A83">
<param name="DataURL" value="MyDatabase.txt">
<param name="FieldDelim" value=";">
<param name="UseHeader" value="true">
</object>

<form name=search onSubmit="return findInPage(this.string.value);">
<b>Search here:</b> <input name=string type=text size=15 onChange="n = 0;">
<INPUT type=submit value=start>
</form>
<IFRAME name="middle" width="223" scrolling="auto" height="267" src="nach.html" frameborder=0 style="border-style: inset; border-width: 2px"></IFRAME>

</body></html>
==================================
P.S. Contents of the data file "MyDatabase.txt"
(First are the keywords, Last are the search results).
This is only example:
==================================
First;Last
a;a word1 word2 word3 word4 word5 word6
able;able word1 word2 word3 word4 word5 word6
absolutely;absolutely word1 word2 word3 word4 word5 word6
accept;accept word1 word2 word3 word4 word5 word6
I;I word1 word2 word3 word4 word5 word6
ice;ice word1 word2 word3 word4 word5 word6
idea;idea word1 word2 word3 word4 word5 word6
if;if word1 word2 word3 word4 word5 word6
ill;ill word1 word2 word3 word4 word5 word6
important;important word1 word2 word3 word4 word5 word6
impossible;impossible word1 word2 word3 word4 word5 word6
impulse;impulse word1 word2 word3 word4 word5 word6
in;in word1 word2 word3 word4 word5 word6
speak;speak word1 word2 word3 word4 word5 word6

Khalid Ali
07-13-2003, 06:00 AM
Please do not keep on posting same topic in new threads.