cityelinks
09-29-2003, 07:01 PM
I am a javascript beginner and having a problem with a script. I need the search results page to open in the the current frame and window. currently, the script pops up a new window. I have tried several things, but to no avail. I know the script that needs to be changed is in the following
function search(frm) {
win = window.open("","","scrollbars");
win.document.write(page);
txt = frm.srchval.value.split(" ");
fnd = new Array(); total=0;
for (i = 0; i < item.length; i++) {
fnd[i] = 0; order = new Array(0, 4, 2, 3);
for (j = 0; j < order.length; j++)
for (k = 0; k < txt.length; k++)
if (item[i][order[j]].toLowerCase().indexOf(txt[k]) > -1 && txt[k] != "")
fnd[i] += (j+1);
}
I am pretty sure it has something to do with the second line. but I can't keep it from opening a new window. Can someone help me with this please? :confused:
Al
function search(frm) {
win = window.open("","","scrollbars");
win.document.write(page);
txt = frm.srchval.value.split(" ");
fnd = new Array(); total=0;
for (i = 0; i < item.length; i++) {
fnd[i] = 0; order = new Array(0, 4, 2, 3);
for (j = 0; j < order.length; j++)
for (k = 0; k < txt.length; k++)
if (item[i][order[j]].toLowerCase().indexOf(txt[k]) > -1 && txt[k] != "")
fnd[i] += (j+1);
}
I am pretty sure it has something to do with the second line. but I can't keep it from opening a new window. Can someone help me with this please? :confused:
Al