House of Fusion
Home of the ColdFusion Community

Search ajax

October 07, 2008

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31   

Subscribe Now
Fusion Authority Quarterly Update - ColdFusion 8 Special Edition
Search over 2,500 ColdFusion resources here  >>>      
Home /  Groups /  Ajax

iframe vs XMLHTTP

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Apples and oranges, Adam.
Steve Brownlee
05/10/05 12:15 P

05/10/2005 09:50 AM
Author:
Adam Haskell

Ik now most people use xmlhttp but I want some reason why to use this over just using n Iframe...I am looking for solid explanations not just..you have better control...how is that I have better control? Adam H

05/10/2005 12:37 PM
Author:
Rob

That's a pretty good question. I would say the main reason is that iframe is a hack, where xmlhttprequest was made for doing what it does. You can get status codes from the request (i.e. 404, 500s) You can get the http headers out of the request - and set them as well. You can do the process in a separate "thread" (asynchronous) ... I can't do to many more or my presentation at the portland UG wont have much content :-D On 5/10/05, Adam Haskell <a.haskell@gmail.com> wrote: > Ik now most people use xmlhttp but I want some reason why to use this > over just using n Iframe...I am looking for solid explanations not > just..you have better control...how is that I have better control? > > Adam H > >

05/10/2005 12:37 PM
Author:
Marlon Moyer

The one benefit I've seen is that you get a ready state change.  It ranges from  0~4 with 4 being completed.  Even if your called function errors out, you'll still get a completed readystate. On 5/10/05, Adam Haskell <a.haskell@gmail.com> wrote: > Ik now most people use xmlhttp but I want some reason why to use this > over just using n Iframe...I am looking for solid explanations not > just..you have better control...how is that I have better control? > > Adam H > >

05/10/2005 12:40 PM
Author:
Marlon Moyer

If you're wanting to play around with xmlhttp calls, I would suggest using the Sarissa project from sourceforge. On 5/10/05, Adam Haskell <a.haskell@gmail.com> wrote: > Ik now most people use xmlhttp but I want some reason why to use this > over just using n Iframe...I am looking for solid explanations not > just..you have better control...how is that I have better control? > > Adam H > >

05/10/2005 12:41 PM
Author:
Marc Campeau

I have used both and you can achieve similar results with both. I prefer to use xmlHttp if I am expecting a result back from a call, that way I don't have to pass a callback function name in the IFrame call to tie both windows together upon return from the request. I've used Iframes when the app doesn't care about the result of the call or at least it's not expecting data to be returned from the call. Marc On 5/10/05, Adam Haskell <a.haskell@gmail.com> wrote: > Ik now most people use xmlhttp but I want some reason why to use this > over just using n Iframe...I am looking for solid explanations not > just..you have better control...how is that I have better control? > > Adam H > >

05/10/2005 12:15 PM
Author:
Steve Brownlee

Apples and oranges, Adam. An XMLHTTP request/response model is a transaction wherein you request another page via HTTP, receive a response, check that response for success or failure and then do XYZ with the data received via Javascript (sometimes very complex Javascript). An IFRAME is simply an inline frame that you can specify as a target for links.

05/10/2005 01:02 PM
Author:
Rob

There is a technique to load xml (or other types of data) via an iframe though, and I think that's what he meant. Thats how http://www.pengoworks.com/index.cfm?action=articles:gatewayApi that used to (or does) work On 5/10/05, Steve Brownlee <Steve.Brownlee@efi.com> wrote:

05/12/2005 08:40 AM
Author:
Thomas Chiverton

> iframe though, and I think that's what he meant. Thats how > http://www.pengoworks.com/index.cfm?action=articles:gatewayApi that > used to (or does) work Yeah, the problem there is that it is single threaded - if you have a request prossing through Gateway, and the user clicks another button you have to manage the 'wait till current request completes', which rapidly becomes a queue. We're finding the Gateway a big bottle neck for that reason. I'm not sure XMLHTTP would fix this, as it then becomes a problem of maintaining state if the 2nd action assumes a consistant state, but action 1 is still changing things (or waiting on the request). -- Tom Chiverton Advanced ColdFusion Programmer

05/12/2005 11:47 AM
Author:
Rob

On 5/12/05, Thomas Chiverton <thomas.chiverton@bluefinger.com> wrote: Yeah, at that point it's more of how you design the application to function - there are ways of doing it so you minimize things, but once you start multi threading the UI you can get some odd things going on - especially if you're not used to multi threaded apps, and double so with JS where you have no built in synchronize type mechinizim. However, you can still pull it off with XMLHTTP and you cant with iframe (unless you have several iframes I suppose...) -- ~Blog~ http://www.robrohan.com ~The cfml plug-in for eclipse~ http://cfeclipse.tigris.org ~open source xslt IDE~ http://treebeard.sourceforge.net

05/10/2005 01:07 PM
Author:
Adam Haskell

No not apples and oragnes..I can do most of that with an Iframe...hidden Iframe and it is a standard unlike XMLHTTP.... On 5/10/05, Steve Brownlee <Steve.Brownlee@efi.com> wrote:

05/10/2005 01:13 PM
Author:
Adam Haskell

Good answers so far...I've only reacently used XMLHTTP and it was in a kix script so I am still learning about it, I've used iframes in webpages to do these tasks for a while though. Only problem now is that people in my work place say XMLHTTP is better but they don't use any of the state bonuses for xmlhttp...just donig what I did with an iframe a few years ago...heh. Adam H On 5/10/05, Adam Haskell <a.haskell@gmail.com> wrote:

05/10/2005 01:26 PM
Author:
Robyn

I've just started playing in the AJAX world, and used to do most of this kind of stuff through IFrames.  I can tell you that AJAX is so, so much easier than using IFrames.  It doesn't have to be a lot of code, and it's *much* easier to manage.  That said, it does mean that you need to know a bit about how how HTTP protocol to get around. -Robyn Adam Haskell wrote:


<< Previous Thread Today's Threads Next Thread >>

Mailing Lists