aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes AJAX in IFrames Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "AJAX in IFrames" Watch "AJAX in IFrames" New topic
Author

AJAX in IFrames

Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
I have a page with two IFrames and both of them load the same nested page. The nested page drills down a hierarchy using AJAX to load cascading selects. One IFrame is Side A of a relationship, the other is Side B.

All works fine in FF. In IE the following function executes the first line (which puts the word "Loading" in both selects) but never calls the server.


I think I made the XHR call good for concurrent requests ...

See me doing anything dumb here? Any issues working in IFrames? I was worried that document.getElementById() might be confused with the same page nested twice, but seeing both of them say "Loading" makes me think that's ok. I'm sure missing Firebug!
[ November 01, 2007: Message edited by: Stan James ]

A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
I would look into the callback variable name/function name.

You should debug with either firebug lite or with classic alerts.

Eric
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Thanks for the tip on firebug lite. I didn't know about that.

Turns out this problem is cache related. Things worked if I cleared cache and refresh. I tested adding current time milliseconds to the URLs to defeat caching and things work fine. I'm reading up (Wikipedia) on manipulating date headers to avoid caching. Anybody have a simpler example of that?
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
xmlhttp.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");

Eric
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Thanks! You've been so good to me I 'm going to start a new thread to reveal the further depths of my ignorance on browser script.
 
 
subject: AJAX in IFrames