SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    Zero Point Zero Siebird's Avatar
    Join Date
    Feb 2007
    Location
    York, PA
    Posts
    456
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    AJAX or iFrames?

    I have a site that I am designing and wondering what is the best way to develop it. I need to use one of these solutions? I was wondering your thoughts? Any great articles/links on this subject? Thanks for the comments!

  2. #2
    SitePoint Zealot ChestRockwell's Avatar
    Join Date
    Nov 2003
    Location
    New Jersey
    Posts
    195
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, the two are not really mutually exclusive. You can use IFrames with your AJAX. It is really going to depend on what you are doing.

    In general, I would rather use AJAX without IFrames. I find IFrames to be clunky and would rather just use a DIV and an AJAX callback function. Check out the prototype framework for some AJAX stuff.
    -- Joe C --
    "Do or do not. There is no try..."
    - Yoda

  3. #3
    SitePoint Enthusiast
    Join Date
    Feb 2007
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If at all possible avoid frames of any kind. If you use AJAX it is much easier to determine when the request is finished when you need to do something after like update content.

  4. #4
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,872
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    There are four ways of using Ajax. iFrames is one of the four ways. The other three are XMLHttpRequest, scripts and images.
    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="^$">

  5. #5
    SitePoint Wizard Hammer65's Avatar
    Join Date
    Nov 2004
    Location
    Lincoln Nebraska
    Posts
    1,161
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    IFrames can be used but they don't provide the status information that the XMLHTTPRequest object does. It takes much more code to work around that problem than it's worth most of the time.

    I have used hidden IFrames for form submissions occasionally, but no matter how you use them, the page that the frame loads has to manually communicate with the master page. There is no browser wide onload event that is transmitted to the master window.


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
  •