Søge script som ikke virke i "Netscape Communicator"
Er der en ekspert der kan hjælpe mig med at få dette søge script til at virke i "Netscape Communicator" det virker fint i "Internet Explorer".<!--------------------- index.htm --------------------->
<HTML>
<HEAD>
<TITLE>Søge</TITLE>
</HEAD>
<FRAMESET ROWS="119,100%" FRAMEBORDER="NO" BORDER="0" FRAMESPACING="0">
<FRAME SRC="top.htm" NAME="top" SCROLLING=NO>
<FRAMESET COLS="135,100%">
<FRAME SRC="main.htm" NAME="main" SCROLLING=AUTO>
</FRAMESET>
</FRAMESET>
</HTML>
<!--------------------- top.htm --------------------->
<html>
<head>
<title>Top</title>
<script>
var NS4 = (parent.main.document.layers);
var IE4 = (parent.main.document.all);
var n = 0;
function findInPage(str) {
var txt, i, found;
if (str == "")
return false;
if (NS4) {
if (!this.find(str))
while(this.find(str, false, true))
n++;
else
n++;
if (n == 0) alert('Der blev ikke fundet noget med "'+str+'" i denne side.');
}
if (IE4) {
txt = this.parent.main.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('Der blev ikke fundet noget med "'+str+'" i denne side.');
}
}
return false;
}
</script>
</head>
<body>
<form name="search" onSubmit="return findInPage(this.string.value);">
<input name="string" type="text" size="10" onChange="n = 0;">
</FORM>
</body>
</html>
<!--------------------- main.htm --------------------->
<html>
<head>
<title>main</title>
</head>
<body>
Søge efter en tekst.
</body>
</html>
