search engine works fine on internet but not locally


P

piet

hi

I've found some code on internet for a search engine to search my own
website.

This script works fine on internet, but not on my own computer.

When I typ in a search item, it opens a new browser window containing
the search restults. I click on the search results, and I get
transferred to the appropriate html page. To return to the search
results, I click on the back button of my browser.

And here is where it goes wrong locally. I get a page without any
images and no working links. On internet I get the all images and I can
click on all links.

I have tried changing all the " to ' and all the " to \" but none of it
resolves the problem.

Does anyone see what I don't?

Thanks piet


page="html code .....snip";
function search(frm) {
win = window.open("","","");
win.document.write(page);
txt = frm.srchval.value.split(" ");
fnd = new Array(); total=0;
for (i = 0; i < item.length; i++) {
fnd = 0; order = new Array(0, 4, 2, 3);
for (j = 0; j < order.length; j++)
for (k = 0; k < txt.length; k++)
if (item[order[j]].toLowerCase().indexOf(txt[k]) > -1 && txt[k] !=
"") fnd += (j+1);
}
for (i = 0; i < fnd.length; i++) {
n = 0; w = -1;
for (j = 0;j < fnd.length; j++)
if (fnd[j] > n) { n = fnd[j]; w = j; };
if (w > -1) total += show(w, win, n);
fnd[w] = 0;
}
win.document.write('</table> ...snip </BODY> </HTML>');
win.document.close();
}
function show(which,wind,num) {
link = item[which][1] + item[which][0];
line = '<tr><td><a href=\''+link+'\'>'+item[which][2]+'</a>
&nbsp;&nbsp;Score: '+num+'<br>'; line += item[which][4]; //+
"<br>"+link+"</td></tr>"; wind.document.write(line);
return 1;
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top