Jump to content
Server Maintenance This Week. ×

javascript not displaying in WebViewer


jimlongo

This topic is 3949 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hi, I have some html/javascript that I'm trying to display in the webviewer.

This code will display a google map with 6 pins in every browser I've tested it in, but shows a blank page in the WebViewer.

Any idea as to what I need to do to fix this would be really appreciated.

I'm on FMPro11 on Mac OSX Lion.
 
(I removed my GoogleKey, gut this code should still work as v3 doesn't require a key)
 
data:text/html, 
<!DOCTYPE html>
<html>
<head>
	<meta charset='utf-8'>
	<title></title>
	<meta name='viewport' content='initial-scale=1.0, user-scalable=no'>
<style type='text/css'>
 html { height: 100% }body { height: 100%; margin: 0; padding: 0 }#map-canvas { height: 100% }</style> 
 <script src='https://maps.googleapis.com/maps/api/js?&amp;sensor=false'></script>
 <script>
 var geocoder;
 var map;
 function initialize() {
	 geocoder = new google.maps.Geocoder();
	 var latlng = new google.maps.LatLng( 43.670234 , -79.386737 );
	 var mapOptions = { zoom: 11, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP }
	 map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
	 var locations = [  '229 Ashworth Avenue, Toronto ON',
			'1112 Queen Street East, Toronto ON',
			'889 Yonge Street, Toronto ON',
			'1711 Melrose Avenue, Toronto ON',
			'2500 Yonge Street, Toronto ON',
			'45 First Avenue, Toronto ON' 	]; 
	 var i; 
	 for (i = 0; i < locations.length; i++) {  
		 geocoder.geocode( { 'address': locations }, function(results, status) {  
		 map.setCenter(results[0].geometry.location);
		 var marker = new google.maps.Marker({ map: map, position: results[0].geometry.location });});}}  
 google.maps.event.addDomListener(window, 'load', initialize);  
 </script> 
	</head>
	<body>
		<div id='map-canvas'>
		</div>
	</body>
</html> 
Link to comment
Share on other sites

i just downloaded the FM12 Pro Advanced Mac trial software and opened the database file with the text shown above and it displayed immediately.

 

But on my FM11 Pro Mac it is a blank web viewer.

 

I was told by someone else that it displayed on their FM11 and FM12 Windows version, so I guess there is some bug in FM11 Mac as it pertains to javascript and the web viewer.

Link to comment
Share on other sites

  • 2 weeks later...

I guess it was "Advanced" that surprised you.

It's just FMPro12, and of course it is available as a 30 day trial from Filemaker.com

 

Regardless my script works fine in v12.

Link to comment
Share on other sites

Idealdata was just challenging your statement about the Advance edition being a demo.

 

FileMaker has never offered a Demo of their Advance or Developer editions of there software.

 

IMO, they are making a BIG mistake by not letting prospective buyers test the Advance edition before they purchase.

Link to comment
Share on other sites

This topic is 3949 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.