[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 433
  • Last Modified:

javascript function on content page load problem

HI All

I am playing around with MS Virtual Earth and have a problem getting the map to show on page load.  I am using a MasterPage site structure so on my content page i cant do <body onload='LoadMap();'>....no worries i would used ClientScript.RegisterStartupScript(GetType(), "map", "<script type='text/javascript'>LoadMap()</script>");
But i get a weird error in IE....i can see the map load in the background with my pin in the right place but then i get a popup.....
IE cannot open the internet site http://blah 
Opertation Aborted

In firefox the map loads without error but without my pin on the map...also a simple input button fails to work in firefox.....even when i only give it an alert to do???? Any ideas on that one.

The way i can get it to work in IE is to use the window_onload.....
<script language="javascript" type="text/javascript" for="window" event="onload">
   return window_onload()
</script>

But firefox ignores that.

so all in all i have a couple of problems and have ran out of ideas/reasons for why this is happening.

Any help greatly appreciated.  I will upload the page to the net somewhere so you can take a look if that would help?

Steve
0
osiris247
Asked:
osiris247
  • 4
  • 4
1 Solution
 
Bob LearnedCommented:
Steve,

I haven't accessed Virtual Earth, but are you getting the site access steps correct.  

Also, have you seen this article?

Build an ASP.NET 2.0 Virtual Earth Map Custom Control
http://www.eggheadcafe.com/articles/20060708.asp

Bob
0
 
osiris247Author Commented:
ok...i kinda have it working.

window.onload=function()
{
  //load map stuff
}
although i still have the problems with firefox
1. the pin is loaded onto the map.  - i will try the virtual earth team for help with this one.
2. my input button is not running any code.
<input id="btnFind" type="button" value="Get Route" style="width: 109px"  onclick="alert('hello')" />
doesnt work in firefox....is there a reason for this that i am not aware of?

Steve
0
 
osiris247Author Commented:
Hi Bob.

I havent seen that article before, thanks.  I have been working from the Virtual Earth SDK. http://dev.live.com/virtualearth/sdk/

I am sure its something to do with firefox that i am unaware of....i dont know a great deal about the difference in browser support, normally more trial and error!! :)

I am sure the input button not running the alert() has something to do with the map not loading correctly in firefox.

cut out the code line by line....see what i get!!!

Steve
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
Bob LearnedCommented:
Steve,

I have played with Google Earth, and it is a significantly better product, so I can understand why Micro$oft feels the need to keep them from doing that without a challenge.  I read that this is an ongoing project, so it might change widely, if you look at Micro$oft's history of doing that.

Bob
0
 
osiris247Author Commented:
Bob, i agree.

I did origianlly want to use google maps but had problems getting it to even show in my page.

I got the key using my url and also localhost but neither worked....i think the problem with the key on my web space is the although the page is www.me.net, when uploading into my space (ftp) i need to go into www.me.net\www\ so might try again with that url.
Not sure about localhost....its quite a problem if i have to upload to web just to test.  Guess it could be that localhost is not public?!

as for the VE problem in firefox i am still not sure after having a look round... http://local.live.com/ works in firefox!?

Steve
0
 
Bob LearnedCommented:
Steve,

I am not sure that I have enough information to be helpful with the Javascript problem.  I can't quite see the entire picture that you have described.

Bob
0
 
osiris247Author Commented:
Bob.

Not sure how to better explain it....you could take a look i have put it on the web... http://www.steveclements.net/Location.aspx
The problem is mainly in firefox....none of the map funcs work...nor does my find directions button.

i also just noticed, i have some javascript swapping an image on timer that doesnt work on the page with VE on.

Drop the guys at VE a message i think, see if i get a responce.

Steve
0
 
Bob LearnedCommented:
Steve,

There are some very strange things that happen with Virtual Earth now.  If you zoom in too far, the picture disappears.   The way that the image redraws when you pan is very funky.  The zooming is way too sensitive.  I believe that Micro$oft has a ways to go to get this to be as easy to use as Google Earth.

I don't have FireFox installed to test this, and I am not going to install it unless I really need to.

Bob
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now