HELP: Accessing object methods/variables across nested documents in IE7

Discussion in 'Javascript' started by davidfass@gmail.com, Apr 17, 2007.

  1. Guest

    I have two questions for the brave of heart:

    (1) I have a main page (http://jewishintellectualtimeline.com/
    index.html) which loads a page "test_map.html" inside an OBJECT (which
    in turn is inside a DIV), like so:

    <div id="object_wrapper">....
    <OBJECT data="test_map.html" width="100%" height="100%">
    <p>Sorry, the map could not be loaded due to browser limitations.</p>
    </OBJECT> ...</div>

    (The reasons for using the OBJECT here are related to limitations of
    the Google Maps API. Not relevant.) Now, in the loaded
    "test_map.html" I have the following script code to assign a name
    "gWindow" to this loaded window:

    window.name = "gWindow";

    The reason I do this is because I want to be able to call functions in
    "test_map.html" from the parent file "index.html". For example, I
    have code in "index.html" like

    onclick="javascript:gWindow.loadMap([[32.536389,44.420833]],
    [[30.5364,42.4208],[34.5364,46.4208]],['Babylonia'])...

    which calls the loadMap function defined in "test_map.html".

    The upshot is that all this works fine in Firefox (no errors from
    Firebug). But in IE7, I get an error saying that "'gWindow' is
    undefined". Any ideas why IE7 cannot see this variable, while Firefox
    can? Workarounds?


    (2) And there is a related issue, which is that the page
    "test_map.html" loaded inside the OBJECT does not see "window.parent"
    as the parent index.html, but rather identifies itself
    ("test_map.html") as window.parent. I'm (obviously) not a
    professional programmer, so I'm wondering whether the fact that it
    works in Firefox is due to a laxity there, or whether there is some IE
    bug that's getting in the way here. Can anyone illuminate, please?

    Thanks a ton for any help! -- Dave
     
    , Apr 17, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    518
    Juan T. Llibre
    Oct 18, 2006
  2. Jeff Louella

    IE7 on XP vs IE7 on Vista

    Jeff Louella, Mar 1, 2007, in forum: HTML
    Replies:
    9
    Views:
    558
    Adrienne Boswell
    Mar 2, 2007
  3. earthwormgaz
    Replies:
    6
    Views:
    373
    Emmanuel Deloget
    Nov 29, 2006
  4. David Garamond

    Sharing variables across methods

    David Garamond, Oct 13, 2004, in forum: Ruby
    Replies:
    16
    Views:
    230
    Jim Weirich
    Oct 14, 2004
  5. Kenneth McDonald
    Replies:
    5
    Views:
    373
    Kenneth McDonald
    Sep 26, 2008
Loading...

Share This Page