Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

AJAX in IFrames

 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
xmlhttp.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");

Eric
 
Stan James
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
reply
    Bookmark Topic Watch Topic
  • New Topic