Technology Questions 

 

Go Back   Technology Questions > Software Questions > Internet > Internet Explorer

Internet Explorer Discuss IE7 or any other IE version.

Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old 05-06-2007, 10:15 AM
muggler
Newsgroup Contributor
 
Posts: n/a
Help: Not seeing variable defined in OBJECT-loaded page

I could use some insight from any JavaSript people here (again). This is a
little convoluted, so bear with me please:

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 becuase 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? Thanks a
lot! -- Dave
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

 
Old 05-06-2007, 10:15 AM
  #2 (permalink)  
Old 05-06-2007, 10:16 AM
muggler
Newsgroup Contributor
 
Posts: n/a
RE: Help: Not seeing variable defined in OBJECT-loaded page

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
(obvioussly) 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?
Thansk. -- Dave

"muggler" wrote:

> I could use some insight from any JavaSript people here (again). This is a
> little convoluted, so bear with me please:
>
> 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 becuase 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? Thanks a
> lot! -- Dave

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how could i know whether a variable has been defined in command line? thinktwice Windows XP 1 04-29-2008 09:40 PM
Page Can not be loaded/ Connection was Reset Error Melzy Windows XP 1 11-13-2007 03:00 PM
loaded page don´t show right jail66 Internet Explorer 1 08-19-2007 12:30 AM
WMP at web page - can not create object danieldc Internet Explorer 3 07-28-2007 08:50 AM
IE7 RC1 does not show full page (images not loaded) fnuman@gmail.com Windows XP 3 01-04-2007 01:08 AM


New To Technology Questions? Do You Need Help?

All times are GMT -8. The time now is 01:21 PM.


2003 - 2009 All Rights Reserved. Technology Questions

Search Engine Friendly URLs by vBSEO 3.3.0