473,602 Members | 2,764 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

GMap disappears when two onload functions are used in <body> tag.

33 New Member
Hello,

Thanks for taking the time to help. I'm having a problem with GMap and IE7 (could be occurring in earlier versions). First let me give you a link to the problem:

problem

The problem seems to manifest itself initially when you mouse over the "Choose a different route >>" link (which has onmouseover event to change font styles). It seems that having two functions in the onload command of the <body> tag is causing the map to disappear, and I can't for the life of me figure this out. One function is loading the map into the "map" DIV, and the other is loading route data into a separate hidden DIV (viewable when clicking the problem link).

I am using scriptaculous to incorporate DIV slide effects for the hidden DIV, could this be causing the problem? Please let me know if any clarification is needed.
Jan 19 '09 #1
8 3026
Dormilich
8,658 Recognized Expert Moderator Expert
@flydev
can't verify that, the hovers toggle the colour (map stays where it is) and the click brings up the new route....

tested on FF 3.0.5 / Mac OS X

by the way, wouldn't it be easier to use CSS' :hover pseudo-class for the colour change?
Jan 19 '09 #2
flydev
33 New Member
@Dormilich
It only appears to happen in IE for some reason...Chrome and FF work fine.

by the way, wouldn't it be easier to use CSS' :hover pseudo-class for the colour change?
Yea, but I was being lazy, that was the only link i was working with at the time and didn't want to change all my style sheets. I changed it to a:hover now to avoid any confusion.
Jan 19 '09 #3
flydev
33 New Member
Since I removed the onmouseover event, it doesnt happen when you mouse over the link, only when you click on it....that seems to imply this occurs whenever another javascript function is being executed.
Jan 19 '09 #4
flydev
33 New Member
I moved all the javascript I could to the <head> section, and I am now using jquery instead of scriptaculous.. .this didn't help...it seems whenever ANY function or javascript is being called after the map is loaded, causes it to disappear....ag ain, only in IE

You can duplicate this by click "Show more routes >>"...this triggers the listener in the <head> section to animate the DIV.
Jan 20 '09 #5
acoder
16,027 Recognized Expert Moderator MVP
There's an error: "map is undefined" or "map is null or not an object" depending on the browser. I've not checked, but that may possibly be the source of the problem.
Jan 21 '09 #6
Dormilich
8,658 Recognized Expert Moderator Expert
maybe it helps to include the ajax script as the last one (if you execute your script before google defines its map object.....)
Jan 21 '09 #7
flydev
33 New Member
@acoder
Unfortunately not, that was just a function to trigger a map.checkResize I wrote to try to fix this, but it didn't fix the problem. I removed it. The map is now sized explicitly within the GMap function (instead of pulling its size from the DIV container)..so the map.checkResize is no longer applicable, but the problem still persists.

maybe it helps to include the ajax script as the last one (if you execute your script before google defines its map object.....)
Well, I did have both functions included in the onload of the <body> tag (GMap first, AJAX second), but that seemed to cause the map to disappear immediately. Now the onload only contains the GMap function, and the AJAX script is triggered by window.onload.. .that seemed to prevent the map from disappearing immediately.

The problem doesn't seem to be the AJAX, it seems to be the DIV resize...whenev er a DIV is being resized (not the GMap DIV), it causes the map to disappear.
Jan 21 '09 #8
flydev
33 New Member
LOL, you know what...im about to smash something if i keep trying to figure this out, I'm 99% sure its just a bug when contents get redrawn on a page the map disappears in IE...I'll just have to use an iFrame (i hate iframes)...than ks much for your help guys!!
Jan 21 '09 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

2
1485
by: Starry Gordon | last post by:
I've been running some small test programs which seem to indicate something noticed in a larger script, that a function called from onLoad() in the <body> tag will not succeed in creating a window (i.e. successfully executing window.open() in Mozilla 1.5; however, I've observed it to work a few times in IE 6.0 and Opera 5.something. It does not seem to be a timing thing -- if I re-call the function somewhat later using setTimeout it still...
1
3050
by: Dung Ping | last post by:
For instance, one set is: <body onload="blinking_header()" onunload="stoptimer()"> Another set is: <body onload="writemsg()" onunload="stoptimer()"> They represent two functions. How to place them in the <body> tag? Thanks.
9
19136
by: bmgz | last post by:
I need to execute a JavaScript function "onload". The only problem is I don not have access to the <body> tag as it is a part of the standard page-header include (a separate file). How could I have certain pages execute my function() onLoad? The function basically just sets the original values of fields so that I can determine if a field has been changed or not, which aleviates unnec. sql update on the backend..
3
2292
by: francescomoi | last post by:
Hi. I'm trying to insert some text between <head> and <body> but I'm not able. I try with: -------- bodyPoint = document.getElementsByTagName('body'); var myLink = document.createElement("a");
15
2240
by: Frances | last post by:
<html> <head> <script> function doIt() { var list = document.forms.product; var selItem = list.options.value; ^^^^^^^ </head>
9
7165
by: tomcadman | last post by:
Using Javascript, how do I give focus to a form text box on page load without using the <body> tag? Thanks!
2
1817
mickey0
by: mickey0 | last post by:
HI, is it possible to do this? I'd like at first execute the ONE and then the TWO. Will it work? <body onload="func1()","func2()"> </body>
8
2243
by: Prisoner at War | last post by:
Another weekend, another project, another problem.... Why should a perfectly fine function work only half-way through when called through onClick in an anchor tag?? The text fade-in script below works when called through onLoad in the <bodytag, but it "hangs" when called through onClick in <a href="#">, as follows: <script language="JavaScript1.2">
23
2221
by: Xah | last post by:
Here's a interesting case of invalid html 4 strict file. In summary, if you have <body></bodywithout any content, the file would be invalid under html 4 strict. Valid if html 4 lose. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/ TR/html4/strict.dtd"> <html> <head> <META HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=utf-8">
0
8401
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8268
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6730
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5867
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5440
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3944
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2418
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1510
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1254
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.