Solved

javascript function on content page load problem

Posted on 2006-07-23
9
414 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now