473,770 Members | 4,999 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Javascript code working in IE and Mozilla but not in Mac

12 New Member
Hi guys

I have a script that uses the google maps geocoder and a html form to pass the javascript variable so to perl. Now all of this seems to work fine in mozilla firefoz and internet explorer but seems to fail when used on an apple mac.

This is a sample of the code:

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  2.     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
  6. <title>Welcome to the Lothian Buses Dynamic Route Selector</title>
  7.     <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAA0j3m7rlEW8A2mxzuyAzXrRQ6jALPQpIWZWNXAFq4N3n_zdAATRSXIi4bVnf99msiXGgcZ9wmNmvEzA"
  8.       type="text/javascript"></script>
  9.  
  10.     <script type="text/javascript">
  11.     //<![CDATA[
  12.  
  13.     var map;
  14.     var geocoder = null;
  15.     var addressMarker;
  16.     var originpoint = null;
  17.     var destinationpoint = null;
  18.  
  19.  
  20.     function load() {
  21.       if (GBrowserIsCompatible()) {
  22.         map = new GMap2(document.getElementById("map"));
  23.         map.addControl(new GSmallMapControl());
  24.         map.addControl(new GMapTypeControl());
  25.         map.setCenter(new GLatLng(55.950254, -3.187606), 10);
  26.  
  27.         geocoder = new GClientGeocoder();
  28.       }
  29.     }
  30.  
  31.     function showAddress(address) {
  32.       if (geocoder) {
  33.         geocoder.getLatLng(address,
  34.           function(point1) {
  35.             if (!point1) {
  36.               alert(address + " not found");
  37.             } else {
  38.               if (addressMarker) {
  39.                 map.removeOverlay(addressMarker);
  40.               }
  41.               addressMarker = new GMarker(point1);
  42.               map.setCenter(point1, 15);
  43.               map.addOverlay(addressMarker);
  44.               originpoint = point1;
  45.             }
  46.           }
  47.         );
  48.       }
  49.     }
  50.  
  51.  
  52.       function setVars()
  53.       {
  54.           document.getElementById('orig').value = originpoint;
  55.           return true;
  56.       }
  57.  
............... ...... And here is the html form that passes the variables:

Expand|Select|Wrap|Line Numbers
  1. <form action="#" onsubmit="showAddress(this.address.value); return false">
  2. <input type="text" size="50" id="addressInput" name="address" value="Type your origin here" />
  3. <input type="submit" class="style4" value="Show Origin" />
  4. <div id="map" style="width: 300px; height: 200px"></div></td>
  5. </form>
  6.  
  7. <form action="http://morar.geos.ed.ac.uk/~s0679212/cgi_bin/sql_test.pl" method="POST" onsubmit="return setVars();">
  8. <input type="hidden" id="orig" name="Origin">
  9. <input type="text" name="Time">
  10. </form>
  11.  
Can anyone suggest something might might be wrong with this? Or something I can change for Mac users?

Thanks in advance for your help
Jul 27 '07 #1
1 1577
pbmods
5,821 Recognized Expert Expert
Heya, Harch.

What is it doing wrong on a Mac? Is this strictly related to Safari, or does it fail in Firefox on a Mac as well?
Jul 28 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
9592
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10231
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10005
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9871
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8887
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7416
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6679
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3576
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2817
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.