Avatar billede fjordbibliotek Nybegynder
01. december 2000 - 10:11 Der er 4 kommentarer og
1 løsning

Frames

  Hvordan undgår man, at søgemaskiner splitter en side med rammer ad?
Avatar billede halnet Nybegynder
01. december 2000 - 10:27 #1
Skal ikke være på din index.html!!! På alle de andre ;o)

<script language=\"JavaScript\"><!--
if (self.location==top.location) {
self.location = \"index.html\";
}
// -->
</script>

- Anders
Avatar billede senj Nybegynder
01. december 2000 - 10:34 #2
Lidt yderligere læsning til weekenden :-)

9.6. How do I make sure my framed documents are displayed inside their frameset?
When the sub-documents of a frameset state are accessed directly, they appear without the context of the surrounding frameset.

If the reader\'s browser has JavaScript support enabled, the following script will restore the frameset:

<SCRIPT TYPE=\"text/javascript\">
<!--
if (parent.location.href == self.location.href) {
    if (window.location.replace)
        window.location.replace(\'frameset.html\');
    else
        // causes problems with back button, but works
        window.location.href = \'frameset.html\';
}
//  -->
</SCRIPT>
A more universal approach is a \"restore frames\" link:

<A HREF=\"frameset.html\" TARGET=\"_top\">Restore Frames</A>

Note that in either case, you must have a separate frameset document for every content document. If you link to the default frameset document, then your reader will get the default content document, rather than the content document he/she was trying to access. These frameset documents should be generated automatically, to avoid the tedium and inaccuracy of creating them by hand.

Note that you can work around the problem with bookmarking frameset states by linking to these separate frameset documents using TARGET=\"_top\", rather than linking to the individual content documents.

9.7. Is there a way to prevent getting framed?
\"Getting framed\" refers to having your documents displayed within someone else\'s frameset without your permission. This can happen accidentally (the frameset author forgot to use TARGET=\"_top\" when linking to your document) or intentionally (the frameset author wanted to display your content with his/her own navigation or banner frames).

To avoid \"framing\" other people\'s documents, you must add TARGET=\"_top\" to all links that lead to documents outside your intended scope.

Unfortunately, there is no reliable way to specify that a particular document should be displayed in the full browser window, rather than in the current frame. If you can configure your server to send the proprietary header Window-Target: _top in the HTTP response, then Netscape browsers will display your document in the full browser window. However, other browsers ignore this header, and it doesn\'t work to use <META HTTP-EQUIV=\"Window-target\" CONTENT=\"_top\"> in the document itself to mimic the HTTP response.

Another workaround is to use <BASE TARGET=\"_top\"> in the document, but this only specifies the default target frame for links in the current document, not for the document itself.

If the reader\'s browser has JavaScript enabled, the following script will automatically remove any existing framesets:

<SCRIPT TYPE=\"text/javascript\">
<!--
if (top.frames.length!=0)
    top.location=self.document.location;
// -->
</SCRIPT>
An alternative script is

<SCRIPT TYPE=\"text/javascript\">
<!--
function breakOut() {
    if (self != top)
        window.open(\"my URL\",\"_top\",\"\");
}
// -->
</SCRIPT>
</HEAD>
<BODY onLoad=\"breakOut()\">
Avatar billede tommyf Nybegynder
01. december 2000 - 16:50 #3
www.metamaten.dk kan du i dine metatags definere at søgemaskinen kun skal optage forsiden (hele framen) i arkivet så er du jo ovre det problem...
Avatar billede fjordbibliotek Nybegynder
01. december 2000 - 21:14 #4
2 gode svar.
I fortjener begge points- men det kan vel ikke lade sig gøre?
Så det må være den første kommentar, der får points
Avatar billede halnet Nybegynder
02. december 2000 - 00:41 #5
Du kan godt dele point mellem flere svar en anden gang... du markerer bare begge navne og trykker accepter ;o)

Men tak...

- Anders
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
Kurser inden for grundlæggende programmering

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