Avatar billede escaton Nybegynder
28. august 2003 - 21:15 Der er 5 kommentarer

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>
Avatar billede cdc Novice
28. august 2003 - 21:31 #1
hvad er navnet på iframen ?
Har du prøvet med <base target="iframenavn">
Avatar billede cdc Novice
28. august 2003 - 21:32 #2
<base target.... skal i head
Avatar billede grunken Nybegynder
28. august 2003 - 21:42 #3
det her burde 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) {

frame = parent.frames['sogeframe']
frame.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, frame, n);
fnd[w] = 0;
}
frame.document.write("</table><br><span class='srestot'>Total found: "+total+"</span><br></body></html>");
frame.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>

<iframe style="heigh:400px;width:300px;" name="sogeframe"></iframe>
</body>
</html>
Avatar billede escaton Nybegynder
28. august 2003 - 21:53 #4
kom med svar for points :P
Avatar billede grunken Nybegynder
28. august 2003 - 22:00 #5
hvem ? ;)
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester