SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    SitePoint Zealot
    Join Date
    Mar 2008
    Posts
    129
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Is the <iframe> acceptable?

    Hey all.

    This is the situation that I'm in. I have a "main page" from which many programs are called. The main page has tabs and when a tab is clicked, a program is called.

    The way I see it, I have a few choices.
    1) Add the "header tabs" to every page and load it.

    2) Never leave the "main page" but instead, load the called programs in an <iframe>

    3) Never leave main page and create sections for each "called program", essentially making the main page ONE big program. When a tab is clicked, the appropriate section is displayed.

    The called pages will have data that needs sorted which I do by sending the necessary info to a routine via AJAX which then displays it to the page.

    I'm looking to do this correctly, any suggestions? Or is there a good book to read on this sort of thing? I was recommended to a book in another thread but haven't had a chance to research it yet so I don't know if that applies.

    ....

  2. #2
    SitePoint Evangelist TommiChi's Avatar
    Join Date
    Oct 2008
    Posts
    440
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Loading one big page might be a bad idea....
    If you already make use of httprequests, then why don't do the same to load the contentof your tabs in container div?

  3. #3
    SitePoint Zealot
    Join Date
    Mar 2008
    Posts
    129
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by TommiChi View Post
    Loading one big page might be a bad idea....
    If you already make use of httprequests, then why don't do the same to load the contentof your tabs in container div?
    By httprequest, you mean AJAX, right?

    I can use AJAX but that means the code loaded will not be "a program", right? Actually, this is how I usually use AJAX to populate a <div>, tell me if I'm way off base here.

    I send parms to the ajax routine, one of them being a "mode". The mode is in a case statement and a procedure is called based on the mode. The procedure runs code and returns the results.

    So basically, if I have a program called pgmA, I would carve out the logic, put it in the procedure to return the results. Then all the CSS/JS files etc needed would go into the <head> of the main program.

    How would you adapt an HTML file that is already created to be called via AJAX?

    The language is in Webspeed by Progress.

    I think this the missing link for me - a typical way of using AJAX. What I do works, but it seems cumbersome.

    ...

  4. #4
    SitePoint Evangelist TommiChi's Avatar
    Join Date
    Oct 2008
    Posts
    440
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    1. Yes I do mean AJAX.
    2. It all depends on your definition of "program". If you mean that the loaded soucre code will not be a stanalone well-formed HTML page, then yes, the loaded components will not be programs
    3. If a complete, standalone and well formed document is what you need then loading them in an iframe is a viable alternative.
    4. If you want your sub-sections to be able to both stand alone and be part of a parent window and interact with it, you must remember to add "window.parent" to all code that you want executed on the main window.
    5. If you could provide a small sample use case it would help better visualize what your exact need is and how to serve it best

  5. #5
    SitePoint Member
    Join Date
    Jan 2009
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Webspeeder View Post
    Hey all.

    This is the situation that I'm in. I have a "main page" from which many programs are called. The main page has tabs and when a tab is clicked, a program is called.

    The way I see it, I have a few choices.
    1) Add the "header tabs" to every page and load it.

    2) Never leave the "main page" but instead, load the called programs in an <iframe>

    3) Never leave main page and create sections for each "called program", essentially making the main page ONE big program. When a tab is clicked, the appropriate section is displayed.

    The called pages will have data that needs sorted which I do by sending the necessary info to a routine via AJAX which then displays it to the page.

    I'm looking to do this correctly, any suggestions? Or is there a good book to read on this sort of thing? I was recommended to a book in another thread but haven't had a chance to research it yet so I don't know if that applies.

    ....
    In terms of SEO using <iframe> on site would bleed the Search Engines. Search engine wont cache this type of websites. Using <iframe> is out of Optimization.
    Gadget Inspectors Offers latest hi tech gadget reviews.

  6. #6
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,278
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    iframe is deprecated in Strict doctypes.

    iframe disallows indexing bots as Clyde said (they will get everything outside of the iframe though).

    iframe is usually (not always) able to be converted to an "include" system. Each chunk of HTML is in an "include". The ones who never change (like say the header include) means the user has just the single GET request for that chunk. Most templating systems use includes. The backend supplies usually just the "main" area when parts of the menu are clicked (using a regular GET request).

    However I can't tell if this is a standard web page or an application (you said "program"). Locking people out of pages of a web site because you chose to use AJAX rather sucks, however if this is an application that is more than acceptable... those without Javascript support simply cannot use the application just as those with ancient hardware cannot install modern programs. But never block information content by requiring scripts.

  7. #7
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Stomme poes View Post
    iframe is deprecated in Strict doctypes.
    That's a pleonasm (or possibly a tautology; I've never really learned to tell those apart), since anything except Strict doctypes is deprecated.

    So 'iframe is deprecated' suffices.
    Birnam wood is come to Dunsinane

  8. #8
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,278
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    Lawlz, you mean I was rhetorical and redundant?? : )

    Since plenty of folks use transitional doctypes, I figured I'd be... thorough. : )

  9. #9
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Better safe than sorry.
    Birnam wood is come to Dunsinane

  10. #10
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,825
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    The problem with iframes being deprecated is that they are supposed to have been replaced by the object tag but that still doesn't function completely correctly in IE8 and earlier.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  11. #11
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    The problem with iframes being deprecated is that they are supposed to have been replaced by the object tag but that still doesn't function completely correctly in IE8 and earlier.
    That is not a problem with iframe or object. That's a problem with Internet Explorer.
    Birnam wood is come to Dunsinane


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
  •