Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Odd GMap2 is Undefined error
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
bs9999  
View profile  
(1 user)  More options May 25 2006, 9:35 pm
From: "bs9999" <bs9...@gmail.com>
Date: Thu, 25 May 2006 18:35:53 -0700
Local: Thurs, May 25 2006 9:35 pm
Subject: Odd GMap2 is Undefined error
I keep getting a GMap2 is undefined within my code:
////////
<html>
  <head>
    <script
src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAUFhArcoq..."
type="text/javascript"></script>
    <script type="text/javascript">
        function aaa()
        {
                var newwin =
window.open('','','scrollbars=no,menubar=no,height=600,width=800,resizable= yes,toolbar=no,location=no,status=no');

                newwin.document.write('<html><head><script
src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAUFhArcoq..."
type="text/javascript"><'+'/'+'script></head><body
onload="setInterval(\'alert(typeof(GMap2))\',1000);"></body></html>');

                newwin.document.close();

        }
    </script>
  </head>
  <body onload ="alert('Main Window GMAP2: '+GMap2);">
    <input type=button onclick="aaa()">
  </body>
</html>
//////////

The way it works is the main window makes the standard JS script call
for Google Maps.  Once the page has loaded the onload event is fired to
present the state of GMap2.  It is defined successfully.

Now when i click the button on the page, it opens a new window and uses
document.write to write a new <script> tag to call google maps for the
new window.  This is where the error occurs.  Once the new window's
onload event fires GMap2 is now undefined and remains that way.  On
inspection of the HTTP requests being made between both windows I
notice the main window makes an additional call to:

http://maps.google.com/mapfiles/maps2.50a.api.js

which the popup window never does.  Both windows do make a successful
call the the <script src> though.

I am using IE6 under Windows XP.  I am using a valid API and as you can
see v=2.  I suspect Javascript is doing something odd here but would
like a javascript fix as opposed to loading a seperate .html file.

Thanks


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
d_henderson  
View profile  
(1 user)  More options May 25 2006, 11:53 pm
From: "d_henderson" <djndn...@gmail.com>
Date: Fri, 26 May 2006 03:53:33 -0000
Local: Thurs, May 25 2006 11:53 pm
Subject: Re: Odd GMap2 is Undefined error
That sounds way too complicated to explain in words.

Please post a link so we can examine what you are actually doing. See
http://mapki.com/wiki/Read_This_First#Post_a_link_not_a_code_snippet

BTW, people hate popup windows enough to keep several popup blockers in
business.


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
bs9999  
View profile  
(1 user)  More options May 26 2006, 9:56 am
From: "bs9999" <bs9...@gmail.com>
Date: Fri, 26 May 2006 06:56:52 -0700
Local: Fri, May 26 2006 9:56 am
Subject: Re: Odd GMap2 is Undefined error
The aforementioned code is all there is.  If you can makeit work then
thats what i want.  So far a tip came in stating to use DEFER within
the script element.  It helped but the google maps display still shows
nothing (less the error message)


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tom Cole  
View profile  
 More options May 26 2006, 12:46 pm
From: "Tom Cole" <tco...@gmail.com>
Date: Fri, 26 May 2006 09:46:40 -0700
Local: Fri, May 26 2006 12:46 pm
Subject: Re: Odd GMap2 is Undefined error
Yes, but when you post a link  others can run the page through
javascript debuggers and see what's going on. It's much more efficient
than manually parsing through a boatload of code like that.

Please post a link, you'll get a faster and more accurate response.


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
bs9999  
View profile  
 More options May 26 2006, 4:02 pm
From: "bs9999" <bs9...@gmail.com>
Date: Fri, 26 May 2006 13:02:27 -0700
Local: Fri, May 26 2006 4:02 pm
Subject: Re: Odd GMap2 is Undefined error
Youre exactly right Tom.  Here is the URL:
http://www.spunge.org/~tony/misc/testpopup.htm
When you click the Do Popup button it opens a new window and performs a
document.write to fill the window with <script> info for google maps
and other elements basically replicating the previous window.  The
window reveals nothing, not even an alert() will popup.  Im unable to
view its source in either FF or IE.  I made some modifications to the
script by adding DEFER and <script></script> within document.write.

Thanks for any assistance.


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
bs9999  
View profile  
 More options May 26 2006, 4:33 pm
From: "bs9999" <bs9...@gmail.com>
Date: Fri, 26 May 2006 13:33:08 -0700
Local: Fri, May 26 2006 4:33 pm
Subject: Re: Odd GMap2 is Undefined error
BTW removing the DEFER from the google maps script element reveals the
GMap2 undefined error.

    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
bs9999  
View profile  
 More options May 26 2006, 4:39 pm
From: "bs9999" <bs9...@gmail.com>
Date: Fri, 26 May 2006 13:39:55 -0700
Local: Fri, May 26 2006 4:39 pm
Subject: Re: Odd GMap2 is Undefined error
Ok Im still messing around within the popup window.  I've placed a
setInterval in onload for the body and notice GMap2 remains undefined.
However when i do a page refresh on the popup, NOW google maps shows it
self and GMap2  == function.  Just wanted to pass this info on to you.
I still dont see how my dynamic html output can benefit.

    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
bs9999  
View profile  
 More options May 26 2006, 8:26 pm
From: "bs9999" <bs9...@gmail.com>
Date: Fri, 26 May 2006 17:26:52 -0700
Local: Fri, May 26 2006 8:26 pm
Subject: Re: Odd GMap2 is Undefined error
I've posted another page that simply cuts to the chance and pops up a
new window but uses the createElement / appendChild approach to build
all the tags.  Still no Google Maps.

Any explanations?

The page is located here:  http://www.spunge.org/~tony/misc/test18.htm


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google