Jump to content
xisto Community

Recommended Posts

Hey, I'm assuming you want a code to break out of frames incase someone opens your website inside a frame on his webside.

You can use the following code to break out of frames:

<script Language='JavaScript'> <!-- if (parent.frames.length==0) parent.location.href="Redirect to?" --> </SCRIPT>

Notice the "Redirect to?" though, you have to replace with with the name of the file, like index.php

Hope it helps!

Share this post


Link to post
Share on other sites

(As for frames, I think frames are pretty much a no-no right now, but iframes are good.)

<{POST_SNAPBACK}>


As a newbie in web design, I am wondering why are frames a no-no? Many people seem to believe that and I am curious to why? Also, what is the difference between frames and iframes?

Share this post


Link to post
Share on other sites

i have nothing directly against it...but they are just annoying to some people. Plus, most of the time, they will load slowly....because now you are loading more then just one page :P

Share this post


Link to post
Share on other sites

Well, the problem with frames is that it creates an extra scroll bar, and also usualluy an ugly seperator bar. It really depends mostly on what you put in your frame- whether it gets in the way or you have to scroll through more than one frame. As for iframes, they move with the page and usually help keep the page at a functional size (I.E. the old dotmanandbob.com, which I would show you if I still did that site...) Anyways, people just like simplicity and ease of use, and frames tend to thwart efforts for both.

Share this post


Link to post
Share on other sites

Frames also happen to occasionally screw up printing of web pages. Granted, people don't print web pages all that often, but when they do, (it used to be anyway, maybe not anymore) that the computer would only print one frame. Sometimes, it wasn't the frame people wanted. And that was the problem.

Share this post


Link to post
Share on other sites

frames are slow and not always supported. that's why they suck hehe.the javascript will remove top banners added by your hosting if that's what you want. or if you' page is opened through hotmail or something alike

Share this post


Link to post
Share on other sites

i actually don't have much of a problem with frames....but it's just that php could be just as effective as frames...and it would be able to run much much faster anyways =P so why use frames anymore?

Share this post


Link to post
Share on other sites

I dunnoe why, but most pro web designers treat designers who use frames as amateurs. There is a sort of contempt associated with designers who use frames. Come to think of it, almost all of the best websites out there dont use frames at all.

Share this post


Link to post
Share on other sites

yea....i've noticed this as well. Perhaps webmasters think frames are an easy way out of actual designing? But it is most likely cause using frames isn't as effective and thus designers laugh in contempt when they see others try to make use of them =P

Share this post


Link to post
Share on other sites

Hey, I'm assuming you want a code to break out of frames incase someone opens your website inside a frame on his webside.

 

You can use the following code to break out of frames:

<script Language='JavaScript'> <!-- if (parent.frames.length==0) parent.location.href="Redirect to?" --> </SCRIPT>

Notice the "Redirect to?" though, you have to replace with with the name of the file, like index.php

 

Hope it helps!

<{POST_SNAPBACK}>


Here's the javascript u should be using;

 

<script TYPE="text/javascript">

<!--

if (top != self)

top.location=self.document.location;

//-->

</SCRIPT>

 

put at the HEAD section.

Share this post


Link to post
Share on other sites

I've never used frames because of all the reasons stated above but I've also never frowned upon their use by another person. I think it's just what you prefer really. I've seen quite a few very successful sites that use frames rather well, no where near the amount of sites that don't use frames of course but who's counting right?

Share this post


Link to post
Share on other sites

I used to use frames in my site, i used em so i could have a nav bar and a music player and a logo and... all in one page and stuff. It worked really well. But yea, frames are slow. They are good if u wanna use em for a special reason, but if ya just makin a site, ya better off without em. I use PHP now. I make php read template files, so all my pages have a logo and copyright etc. PHP is the best. I wouldve posted the javascript code here, but someone already has! ^_^

Share this post


Link to post
Share on other sites

I had used frames on my last site simply cos it made navigation much easier than back buttons or linking all over the place. I don't see how it can be much slower as more and more ppl are using cable or DSL, so pages load pretty quickly with them. Best thing to do is simply give ppl the option of viewing your site with or without them ^_^

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.