Forum Moderators: open

Message Too Old, No Replies

Which of these is the best?

Frame breaker query?

         

foxtunes

11:36 pm on Feb 20, 2005 (gmt 0)

10+ Year Member



Hello java script experts :)

I'm trying to decide which frame breaker to use and where to use it on the index.html page of my sites. I've tried this one right at the bottom of my page code, before the close of the </body> tag

<script language="javascript1.1" type="text/javascript"> <!--
if (parent.frames.length > 0) top.location.replace(document.location); // Escape from frame, but retain one-click "Back". -->
</script>

Also tried this one at the top of the page right after the opening <body> tag:

<script language="JavaScript" type="text/JavaScript">if (parent.frames.length > 0) top.location.replace(document.location);</script>

Lastly this one:

<HEAD>; ... <SCRIPT type="text/javascript">; if(self!= top) top.location.href = self.location.href; </SCRIPT>; ... </HEAD>

Does it matter?

Thanks in advance.

Bernard Marx

11:42 pm on Feb 20, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A hot topic, it seems:
[webmasterworld.com...]

foxtunes

12:33 am on Feb 21, 2005 (gmt 0)

10+ Year Member



Thanks, so there's more than one way to frame bust.

Is it best to put the code near the top of the page, at the bottom or doesn't it make any difference?

kaled

12:38 am on Feb 21, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The <head> is probably the best place to put a framebreaker.

Kaled.

foxtunes

12:53 am on Feb 21, 2005 (gmt 0)

10+ Year Member



Thanks Kaled.

Have you noticed whether using frame breaking code in your site is detrimental to search engine rankings?

Do the spiders just skip right past the java script code or does it impede them slightly?

kaled

11:11 am on Feb 21, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Scripts in general should have zero impact on search engines.

Incidentally, I don't use framebreakers on my site. My site uses frames so standard framebreakers are unsuitable. I've experimented with alternate strategies but have yet to find anything that works reliably on all browsers - perhaps I'll have another look at this.

Kaled.

foxtunes

3:57 pm on Feb 21, 2005 (gmt 0)

10+ Year Member



Appreciate you sharing your javascript expertise.

Cheers.