I have seen similar messages before, but none of the solutions that I have seen on the Internet seem to work for me.
I am trying to use a WebBrowser control to display a locally stored HTML file that uses the JavaScript API for Google Maps, but JavaScript remains stubborn.
To check the problem, I made a simple page using Google Maps based on https://developers.google.com/maps/documentation/javascript/examples/map-simple . I also added a button to check if JavaScript is working
c: \ map-test.html works fine in both Firefox and IE.
<!DOCTYPE html> <html> <head> <title>Google Maps JavaScript API v3 Example: Map Simple</title> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"> <meta charset="utf-8"> <style> html, body, #map_canvas { margin: 0; padding: 0; height: 100%; } </style> <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script> <script> var map; function initialize() { var mapOptions = { zoom: 8, center: new google.maps.LatLng(-34.397, 150.644), mapTypeId: google.maps.MapTypeId.ROADMAP }; map = new google.maps.Map(document.getElementById('map_canvas'), mapOptions); } google.maps.event.addDomListener(window, 'load', initialize); </script> </head> <body> <input type="button" onclick="alert('JavaScript Functioning');" value="Test JavaScript"> <div id="map_canvas"></div> </body> </html>
Then I created the MS Access form using a WebBrowser control named cWebBrowser and added the c: \ map-test.html download method. The Google Maps interface does not load, and the test button does not work.
Private Sub Form_Current() Me.cWebBrowser.ControlSource = "=(""file:///C:/map-test.html"")" End Sub
Then I tried the online version of the map - simply. JavaScript worked as expected and the Google Map interface loaded
Private Sub Form_Current() Me.cWebBrowser.ControlSource = "=(""https://google-developers.appspot.com/maps/documentation/javascript/examples/map-simple"")" End Sub
I tried to solve this problem for quite some time without success.
After this article http://support.microsoft.com/?kbid=315933 I turned on "My Computer Zone" in IE security settings
In all areas, I have included the following:
- Allow Microsoft Web Browser Control Scripting
- Active scripting
In the Advanced tab, I have included the following:
- Allow running active content from CDs on my computer
- Allow running active content in files on my computer
Someone suggested adding Mark of the Web to my pages, but that didn't help either.
I tried to clear the cache.
I tried to change the file name if the cache remained after cleaning.
map-test.html works when loaded in IE and WebBrowser Control, but only works locally using IE. What else could cause a problem other than the security setting? Is there a security setting I'm missing? Is there any other test I could do to diagnose the problem?
I'm crazy.
Environment:
Windows 7 64bit
Access 2010
IE 9
PS
The problem keeps getting weirder
Today I tried to create an extremely simple JavaScript page to make sure that the reason for this is not the Google Maps code.
<!DOCTYPE html> <html> <body> <input type="button" onclick="alert('JavaScript Functioning');" value="Test JavaScript"> </body> </html>
At first I worked, and I was delighted. Then I tried the Google Maps test page and it works too! So, I tried my full-featured map (working in IE and Firefox), which loads the JSON output from my DB application, and all this was confusing, the Google Maps code internally caused numerous errors (unfortunately, I did not document the errors).
Now I will return to the fourth; none of the pages allows you to create scripts, including 5 liners above?!?!