SitePoint Sponsor

User Tag List

Results 1 to 24 of 24

Thread: Is IFRAME ok?

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Location
    Sipovo
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Is IFRAME ok?

    IFRame is deprecated in HTML 4.x/XHTML 1.0. Dropped in XHTML 1.1.

    What should I use? Divs with overflow? How to scroll content so that last lines are visible not first?

  2. #2
    ✯✯✯ silver trophybronze trophy php_daemon's Avatar
    Join Date
    Mar 2006
    Posts
    5,284
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I'd use div.

    To scroll down to the bottom, you could use some JavaScript:
    HTML Code:
    <div id="div1" class="dv1">
      <!-- content -->
    </div>
    <script type="text/javascript">
      div1=document.getElementById('div1');
      div1.scrollTop = div1.scrollHeight;
    </script>
    Saul

  3. #3
    SitePoint Guru momos's Avatar
    Join Date
    Apr 2004
    Location
    Belgium
    Posts
    920
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    few years of patience and you'l be able to use xframes, the successor of frames

  4. #4
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Location
    Sipovo
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for response. It works in Firefox and Opera ok. It works in IE for first page load, but when I refresh page, content is scrolled only half way down.

    Any suggestion?

  5. #5
    SitePoint Wizard drhowarddrfine's Avatar
    Join Date
    Aug 2005
    Posts
    3,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    IFRame is deprecated in HTML 4.x/XHTML 1.0. Dropped in XHTML 1.1.
    Totally false.

  6. #6
    \m/\m/ karinne's Avatar
    Join Date
    Dec 2002
    Location
    Aylmer, QC, Canada
    Posts
    409
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by drhowarddrfine
    Quote Originally Posted by papaja
    IFRame is deprecated in HTML 4.x/XHTML 1.0. Dropped in XHTML 1.1.
    Totally false.
    +1

    Going through the list of elements from the W3 site ... there's no "D" on there in the "Depr" column beside IFRAME to state that it is.

    So ... who told you that?

  7. #7
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Location
    Sipovo
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    +100

    Thanks a lot, you really helped me

    I din't ask this in order to argue, but to learn. W3C site is real nightmare for me, so I asked.

    My question was really simple: should I use IFrame, or something else in xHTML 1.1, since page with iframe does NOT pass html validation?

  8. #8
    SitePoint Wizard drhowarddrfine's Avatar
    Join Date
    Aug 2005
    Posts
    3,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    page with iframe does NOT pass html validation?
    Also not true. Are you using the proper doctype?:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
    "http://www.w3.org/TR/html4/frameset.dtd">

    should I use IFrame, or something else in xHTML 1.1
    You should not be using 1.1 if you are serving it as text/html, which you probably are.

  9. #9
    \m/\m/ karinne's Avatar
    Join Date
    Dec 2002
    Location
    Aylmer, QC, Canada
    Posts
    409
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If what drhowarddrfine said didn't help, give us a link so we can check it out.

  10. #10
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Location
    Sipovo
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    drhowarddrfine didn't try to help. He/she just wanted to prove that I'm wrong, and that IFrame is not deprecated so it is safe to use it.

    I would appreciate responses like one of php_daemon more, but ok.

    Can someone comment this topic: http://www.sitepoint.com/forums/show....php?t=431848? I might be wrong again, but please, please try to focus on my problem not on proving that I'm wrong.

  11. #11
    \m/\m/ karinne's Avatar
    Join Date
    Dec 2002
    Location
    Aylmer, QC, Canada
    Posts
    409
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    IFRAME is NOT deprecated!

    This is perfectly valid code
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    	  <title>Untitled Document</title>
    </head>
    
    <body>
    <iframe src="foo.html" width="400" height="500" scrolling="auto" frameborder="1">
      [Your user agent does not support frames or is currently configured
      not to display frames. However, you may visit
      <a href="foo.html">the related document.</a>]
      </iframe>
    </body>
    </html>
    If you page didn't pass validation with it why don't you give us a link so we can figure it out with you.

  12. #12
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,495
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As others have told you, iFrames are perfectly acceptable to use in HTML 4.01 and XHTML 1.0 frameset and transitional DOCTYPEs.

    If you don't want to use iFrames (and if I'm reading this right, you're using XHTML 1.1, which means you pretty much have no choice if you want your page to validate), you basically have two choices. One is to use the OBJECT element to insert your other page (you'll have to use conditional comments and a DIV for IE) or to use a DIV in conjunction with either server-side includes (SSI) or a server-side programming language like ASP, PHP, or Perl to "include" your document into the main page.

    As in cases like this I find both to be rather messy, I tend to stick with iFrames (keep in mind I rarely use iFrames anyway). If you'd like to learn more, go to www.w3schools.com (no affiliation with the W3C itself) and check it out for yourself. Their reference on iFrames is here:
    http://www.w3schools.com/tags/tag_iframe.asp

    Just keep in mind that if you go with iFrames (and want the page to validate) you won't be able to use a Strict HTML 4.01 or XHTML 1.0 DOCTYPE or XHTML 1.1 either. It's unfortunate, but that's the way the proverbial cookie crumbles.

    If you still need help, feel free to post here and one of us will be more than happy to.

  13. #13
    ✯✯✯ silver trophybronze trophy php_daemon's Avatar
    Join Date
    Mar 2006
    Posts
    5,284
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by papaja
    Thanks for response. It works in Firefox and Opera ok. It works in IE for first page load, but when I refresh page, content is scrolled only half way down.

    Any suggestion?
    Hm, strange, I used this method for a js chat script, it worked on all browsers. It's IE6, isn't it? Could be a bug. I've installed IE7 and currently don't have an older one to test on.

    It works on IE7, maybe it's just the right time to forget about the oldies and move on.
    Saul

  14. #14
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,495
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    IE 7 will only install on Windows XP and Vista. A lot of people still use Windows 98SE and 2000, and a few still use Windows ME.

    In other words, Internet Explorer 6 is like the monkey in "Pirates of the Carribean 2" - it WILL NOT DIE.

  15. #15
    \m/\m/ karinne's Avatar
    Join Date
    Dec 2002
    Location
    Aylmer, QC, Canada
    Posts
    409
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dan Schulz
    In other words, Internet Explorer 6 is like the monkey in "Pirates of the Carribean 2" - it WILL NOT DIE.

  16. #16
    ✯✯✯ silver trophybronze trophy php_daemon's Avatar
    Join Date
    Mar 2006
    Posts
    5,284
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dan Schulz
    IE 7 will only install on Windows XP and Vista. A lot of people still use Windows 98SE and 2000, and a few still use Windows ME.

    In other words, Internet Explorer 6 is like the monkey in "Pirates of the Carribean 2" - it WILL NOT DIE.
    Fortunately I didn't see the movie.

    There are some people still using IE5 but we can't fully support all of them. Take this situation for example, who cares that some people get mid scrolled div upon page refresh? That's really not a big issue, if you will.
    Saul

  17. #17
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,495
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For IE 5x, it's best to determine whether you'll support that generation or not by checking the server stats (for an existing site), and to make the site work as well as reasonably possible for that archaic browser for a new site.

  18. #18
    ✯✯✯ silver trophybronze trophy php_daemon's Avatar
    Join Date
    Mar 2006
    Posts
    5,284
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Yes. I just wanted to say that one should not worry about relatively small flaws on old browsers. Just like in this particular papaja's case.
    Saul

  19. #19
    SitePoint Member
    Join Date
    Oct 2006
    Location
    Seattle
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    papaja I agree 100%. With the new wave of browsers coming out. I noticed that when Flash 8 came out it was very hard to find users that had it loaded. Now it seems like almost everyone has Flash 9. Maybe its just my site. The oldest browsers I have seen are IE5.5 Poor souls. After IE 7.0 and Firefox 2.0 which give a good compelling reason to upgrade more browsers should be up to date.

    Granted my 2 cents worth opn the topic what do i know
    Web Designer and Telecom Engineer
    http://www.ecarttemplates.com
    http://www.telexus.net

  20. #20
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Location
    Sipovo
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by php_daemon
    Yes. I just wanted to say that one should not worry about relatively small flaws on old browsers. Just like in this particular papaja's case.
    Yes, but if it is in some kind of chat app, than it is not small flaw.

    It seems that I'll stick to IFrame. How to scroll IFrame to bottom?

  21. #21
    SitePoint Wizard silver trophybronze trophy Stormrider's Avatar
    Join Date
    Sep 2006
    Location
    Nottingham, UK
    Posts
    3,133
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    People still using the older browsers though just won't be affected by IE7 / FF2 releases. They will continue to use these old browsers unfortunately.

  22. #22
    SitePoint Guru Ize's Avatar
    Join Date
    Nov 2005
    Location
    The Netherlands
    Posts
    809
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by papaja
    Yes, but if it is in some kind of chat app, than it is not small flaw.

    It seems that I'll stick to IFrame. How to scroll IFrame to bottom?
    I've made a chat app once, using a div to show the messages.
    I used the following:

    when a user added a chat message, that new message received an id (something like "message54"). I then added a hash to window.location (something like "http://www.foo.com/bar.html#message54"). That way, the browser focuses directly on the message added last.

    Hope this helps

  23. #23
    SitePoint Zealot
    Join Date
    Mar 2006
    Posts
    190
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i got it in a notepad file ill post it soon as i find
    Failure: Failure is the dress rehearsal for success.

    Statistics: The only science that enables different
    experts using the same figures to draw different conclusions.

  24. #24
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Location
    Sipovo
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This sounds interestingly and looks like good direction.

    Thanks


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •