Free2Code
The majority of forums are now only available as archives, which means posting/editing is disabled.

The Anything and Everything forum is still open.
 
Time: 2013-05-23, 03:49pm
iFrames - Good or Bad?
Subject: iFrames - Good or Bad?  ·  Posted: 2003-08-26, 10:58am
Rank: ? (117)
Member #: 7875
What are your opinions on iFrames? In theory I think they're terrific, but I don't know very much about their compatibility with browsers other than IE. I'm currently conceptualizing a site that would need extensive iFrames, or at least several scrollable areas within the site. Are there different ways to do this other than iFrames? Are iFrames good or bad? Your thoughts would be appreciated!

_______________________ AIOFREAK
 
  Reply to this ·  Post link ·  Top
Subject: Re: iFrames - Good or Bad?  ·  Posted: 2003-08-26, 11:04am
Rank: ? (172)
Member #: 8641
I've used iFrames in many different layouts for my site.

Some compliants I got when I used them was:

1. Pages didn't load
2. Site download time is too long
3. Confusing navigation

As far of another way I'm not really sure, but I seen somewhere in the PHP section I thing on how to use tables with scrolling. I'm not sure if its possible but I think I read that somewhere.

Anyways now I don't recommend using iFrames unless it would be for something like previewing and image thumbnail.
ex. an image gallery with text links to thumbnails



-TwiztedFake-
 
  Reply to this ·  Post link ·  Top
Subject: Re: iFrames - Good or Bad?  ·  Posted: 2003-08-26, 04:33pm
Rank: ? (4827)
Member #: 3416
i think most newer browsers handle iframes okay, but yes there certainly are other ways to handle it. you can use css to define an area of a certain size that will have scrollbars if necessary, and then you just include the code you want inside that element. you can use php or ssi for the includes, or you could call a javascript that would print out the html. if you want to try that instead of iframes, there are plenty of people here who would be able to help you set something up!

my mind is like a steel trap! it only hangs on to the big stuff. visit my forums at track7.org
 
  Reply to this ·  Post link ·  Top
Subject: Re: iFrames - Good or Bad?  ·  Posted: 2003-08-26, 06:16pm
Rank: ? (168)
Member #: 8368
i personally try and make my webpages compatible to all browsers - that is good coding and nothing extra special

and i believe that iFrames do not work wonderfully well in browsers other than IE, so i would suggest you not to use them especially if you are making a business site, but if you are only making a personal site, then you could probably consider using iFrames as it will make many things simpler!

in the end its your choice as you are the webmaster :P

"Only two things are infinite, the universe and human stupidity, and I'm not sure about the former." Albert Einstein
 
  Reply to this ·  Post link ·  Top
Subject: Re: iFrames - Good or Bad?  ·  Posted: 2003-08-27, 10:11am
Rank: ? (1045)
Member #: 2150
To have a scrollbar, you could use css to do this. The css function overflow: auto or overflow: scroll creates a scrollbar if the content in the item exceeds it given width and height (here 100x100px).
Code:
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html>
  3. <head>
  4. <meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
  5. <title>test</title>
  6. <style type="text/css" media="screen">
  7. <!--
  8. #scrollarea  { position: relative; top: 100px; left: 100px; width: 100px; height: 100px; visibility: visible; display: block; border: 1px dashed #000000; overflow: auto;}
  9. -->
  10. </style>
  11. </head>
  12. <body>
  13. <div id="scrollarea">
  14. A lot of text. A lot of text. A lot of text.
  15. A lot of text. A lot of text. A lot of text.
  16. A lot of text. A lot of text. A lot of text.
  17. A lot of text. A lot of text. A lot of text.
  18. </div>
  19. </body>
  20. </html>

You could put the css in a stylesheet file if you want to. Look at w3schools for more information and examples.

"Your coding is godly, Mav. Stop watching porn and do something with your life!" -.- (Farley)
 
  Reply to this ·  Post link ·  Top
Subject: iframes are bad  ·  Posted: 2003-08-27, 10:25am
Rank: ? (383)
Member #: 867
You guys have said pretty much all I'd say to aiofreak in reply to his post, but I do have something to add.

Iframes are compatible only in the latest browsers, so they're even worse than frames. Don't use them. Use CSS as MavDude showed you if you want to make scrollable areas.

This comment is copyright by Dino (http://dino.shiftedphase.com/) and may not be reproduced without written permission of the housing authority, the Senate, the United Nations, my neighbour's dog, the grocer and the guy who just jumped off the bridge
 
  Reply to this ·  Post link ·  Top
Subject: Re: iFrames - Good or Bad?  ·  Posted: 2003-08-27, 10:34am
Rank: ? (117)
Member #: 7875
Okay, so we've got some major opinions about iFrames here Thanks for the help. I had heard that iFrames weren't very compatible with browsers other than IE, but I'd never used them before, so I didn't know for sure. I think I'll try that CSS trick MavDude. Thanks a bunch!

_______________________ AIOFREAK
 
  Reply to this ·  Post link ·  Top
Subject: Re: iFrames - Good or Bad?  ·  Posted: 2003-08-27, 01:11pm
Rank: ? (1045)
Member #: 2150
No problem
But I think Iframes aren't all that bad, exept if you use a really old browser. For example, I had a shoutbox on my site that was in a Iframe. Now if the visitor has an old browser that can't show Iframes, then the visitor would see a link that would open the shoutbox in another window. Not the most ideal option, but for things like shoutboxes which usually come in an Iframe the best way to go.
Here's the code I used.
Code:
  1. <iframe src="shoutbox/viewshoutbox.php" width="135" height="300">
  2. <a href="shoutbox/expanded.php">View the shoutbox</a>
  3. </iframe>

The link "view the shoutbox" would only display on those browsers that don't show Iframes.
But if you only need a scrollbar for texts, I suggest the css method.

"Your coding is godly, Mav. Stop watching porn and do something with your life!" -.- (Farley)
 
  Reply to this ·  Post link ·  Top
Subject: Re: iFrames - Good or Bad?  ·  Posted: 2003-08-28, 12:15pm
Rank: ? (3049)
Member #: 265
i'm using ie 6.0 but i don't know why the pages don't load into the frame....i set it as a target and got everything names accordingly but still it loads into a new window....what's wrong?

<Farley> or think of me in a micromini thong <Jester> my willy died
 
  Reply to this ·  Post link ·  Top
Subject: reply  ·  Posted: 2003-08-29, 01:21am
Rank: ? (383)
Member #: 867
 MavDude
if the visitor has an old browser that can't show Iframes, then the visitor would see a link that would open the shoutbox in another window


I still think an alternative method is more practical. Why not use a CSS scroll area and use PHP to include the shoutbox? Something like this:

<div style="width:135px; height:135px; overflow:scroll;">
<?php include("shoutbox/viewshoutbox.php"; ?>
</div>

Then everyone would be happy.

 retarded
i'm using ie 6.0 but i don't know why the pages don't load into the frame....i set it as a target and got everything names accordingly but still it loads into a new window....what's wrong?


You didn't use target="_blank", right?

Can you show us the site or the code?

This comment is copyright by Dino (http://dino.shiftedphase.com/) and may not be reproduced without written permission of the housing authority, the Senate, the United Nations, my neighbour's dog, the grocer and the guy who just jumped off the bridge
 
  Reply to this ·  Post link ·  Top
Subject: Re: reply  ·  Posted: 2003-08-29, 01:42am
Rank: ? (1045)
Member #: 2150
 Dino
I still think an alternative method is more practical. Why not use a CSS scroll area and use PHP to include the shoutbox? Something like this:
<div style="width:135px; height:135px; overflow:scroll;">
<?php include("shoutbox/viewshoutbox.php"; ?>
</div>

Yeah if I could do that somehow.. I've already tried but ran into several problems, it uses it own stylesheet.. and in a div the content suddenly is all weird aligned etc.. blah.. it's just easier in an iframe hehe. Maybe I'll try again later.

And to retarded: I think you have to give the iframe a name and do target="name" before it gets loaded in the Iframe.

"Your coding is godly, Mav. Stop watching porn and do something with your life!" -.- (Farley)
 
  Reply to this ·  Post link ·  Top
Subject: :p  ·  Posted: 2003-08-29, 04:18am
Rank: ? (383)
Member #: 867
You don't have to use a DIV, you can use a <p>aragraph or something. And you can always adapt the CSS to work well (for example, use an internal stylesheet for your page and use the shoutbox's stylesheet for the shoutbox).

This comment is copyright by Dino (http://dino.shiftedphase.com/) and may not be reproduced without written permission of the housing authority, the Senate, the United Nations, my neighbour's dog, the grocer and the guy who just jumped off the bridge
 
  Reply to this ·  Post link ·  Top
Subject: Re: iFrames - Good or Bad?  ·  Posted: 2003-08-29, 07:18am
Rank: ? (4827)
Member #: 3416
 Dino
use an internal stylesheet for your page and use the shoutbox's stylesheet for the shoutbox


how would you do that if the shoutbox is included via php? for example, what if you had div.date defined differently for the page and the shoutbox? if there's no overlap then you can just include all the css for the whole page, but i don't know what you would do if there was overlap, other than rewrite one of them so there isn't.

my mind is like a steel trap! it only hangs on to the big stuff. visit my forums at track7.org
 
  Reply to this ·  Post link ·  Top
Subject: Re: iFrames - Good or Bad?  ·  Posted: 2003-08-29, 11:17am
Rank: ? (1045)
Member #: 2150
yeah.. well it is possible to include several stylesheets on 1 page so.. it is all possible, but the hassle is just too much hehe :[

"Your coding is godly, Mav. Stop watching porn and do something with your life!" -.- (Farley)
 
  Reply to this ·  Post link ·  Top

Pages: 1

Please login or register to post a reply.

Penguino AVR

Want to learn about robotics or microcontrollers?
Check out the Penguino AVR from our friends at
Icy Labs