Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Load specific pages into a frame from a window that is not in frameset

Status
Not open for further replies.

cjrussell

Technical User
Aug 8, 2007
1
CA
For my search engine I need to have results from a search opened in a new window as links. My issue is I need those links to open the appropriate file in a certain frame? can anyone help, Im really stuck with this one:

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 = 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><br><font face='Arial' size='2'>Total found: "+total+"</font><br></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;&nbsp; Relevancy: "+num+" / 10<br>";
wind.document.write(line);
return 1;
}
 
If you need to target a specific frame, and it will be the same frame every time, do this in your function show:
Code:
function show(which,wind,num) {
link = item[which][1] + item[which][0];
line = "<tr><td><a href='"+link+"' [red]target="[b]frameName[/b]"[/red]>"+item[which][2]+"</a> &nbsp;&nbsp;&nbsp; Relevancy: "+num+" / 10<br>";
wind.document.write(line);
return 1;
}
Just replace the name of your frame with [red]frameName[/red].

Hope that helps.

Einstein47
There are no kangaroos in Austria!
[&#91;]Starbase47.com]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top