Solved

javascript function on content page load problem

Posted on 2006-07-23
9
411 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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

746 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

9 Experts available now in Live!

Get 1:1 Help Now