Solved

javascript function on content page load problem

Posted on 2006-07-23
9
419 Views
Last Modified: 2012-06-21
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
Comment
Question by:osiris247
  • 4
  • 4
9 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 17162750
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
 
LVL 7

Author Comment

by:osiris247
ID: 17162770
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
 
LVL 7

Author Comment

by:osiris247
ID: 17162789
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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 96

Expert Comment

by:Bob Learned
ID: 17162799
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
 
LVL 7

Author Comment

by:osiris247
ID: 17162920
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
 
LVL 96

Expert Comment

by:Bob Learned
ID: 17162942
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
 
LVL 7

Author Comment

by:osiris247
ID: 17163047
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
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 17163065
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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question