Skal ikke åbne i nyt vindue, men i en iframe
Her er koden men jeg kan ikke få den til at åbne i en iframe istedet for i et nyt vindue, kan du?<head>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var item = new Array();
// "Page Name","path","Page Title","Many,Key,Words","Descriptive Comments"
c=0; item[c]=new Array("iframeindex.htm","","News","news","News page with all updated information about http://www.fairshow.com.");
c++; item[c]=new Array("iframecontact.htm","","Contact","contact,email,address","Contact the team behind http://www.fairshow.com.");
c++; item[c]=new Array("iframecopyright.htm","","Copyright","copyright,rules,rule","Read the copyright.");
c++; item[c]=new Array("iframeinformation.htm","","Information","information","Read all that is worth to know about http://www.fairshow.com.");
c++; item[c]=new Array("iframesignup.htm","","Sign Up","sign up","See how you get a stand and sign up for one here.");
c++; item[c]=new Array("sitemap.htm","","Sitemap","sitemap,find","Sitemap over http://www.fairshow.com.");
c++; item[c]=new Array("iframeboat.htm","halls/boat/","Boat","boat,hall","Hall site for all boat stand.");
c++; item[c]=new Array("iframecar.htm","halls/car/","Car","Car,hall","Hall site for all car stand.");
c++; item[c]=new Array("bilbiksen.htm","halls/car/bilbiksen/","Bilbiksen","Car,bilbiksen,104,","Bilbiksen Stand, an stand full of the newest cars.");
c++; item[c]=new Array("iframecomputer.htm","halls/computer/","Computer","computer,hall","Hall site for all computer stand.");
c++; item[c]=new Array("iframecooking.htm","halls/cooking/","Cooking","cooking,hall","Hall site for all cooking stand.");
c++; item[c]=new Array("iframefarming.htm","halls/farming/","Farming","farming,hall","Hall site for all farming stand.");
c++; item[c]=new Array("iframefishing.htm","halls/fishing/","Fishing","fishing,hall","Hall site for all fishing stand.");
c++; item[c]=new Array("iframehome.htm","halls/home/","Home","home,hall","Hall site for all home stand.");
c++; item[c]=new Array("iframekitchen.htm","halls/kitchen/","Kitchen","kitchen,hall","Hall site for all kitchen stand.");
c++; item[c]=new Array("iframetravel.htm","halls/travel/","Travel","travel,hall","Hall site for all travel stand.");
pagefont = "verdana"
linkcolor = "0000FF"
linkfontsize = "10"
bodyfontsize = "10"
bodycolor = "000000"
bundfontsize = "8"
bundcolor = "0000FF"
page="<html><style = 'text/css'>.sreslink {font-size: " + linkfontsize + "pt; color: #" + linkcolor + "; font-family: " + pagefont + "} .sresbod {font-size: " + bodyfontsize + "pt; color: #" + bodycolor + "; font-family = " + pagefont + "} .srestot {font-size: " + bundfontsize + "pt; color: " + bundcolor + "; font-family: " + pagefont + "}</style><head><title>Search Results</title></head><body bgcolor='#EAE3AD'><center><table border=0 cellspacing=10 width=80%>";
function search(frm) {
win = iframe("","","scrollbars;auto,resizable=0,height=550,width=540");
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);
}
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><span class='srestot'>Total found: "+total+"</span><br></body></html>");
win.document.close();
}
function show(which,wind,num) {
link = item[which][1] + item[which][0];
line = "<tr><td><a class='sreslink' href='"+link+"'>"+item[which][2]+"</a> <br><span class='sresbod'>";
line += item[which][4] + "<span><br></td></tr>";
wind.document.write(line);
return 1;
}
// End -->
</script>
</head>
<body>
<form method=get action="java script:void(0)" onsubmit="search(this); return false;">
Search:<br>
<input type=text name=srchval value="" size="13"><br>
<input type=submit value="Go!">
</form>