title: Javascript code works locally, but not on server
body: <p>I made a simple page on google maps, showing a bunch of pointers.
  When I try this code on my PC, it works without any problem.</p>
  
  <p>But, when I upload the files on my server, the Google Map dosen't show up, and I get the followings errors : </p>
  
  <pre><code>SyntaxError: invalid property id variables.js:1 
  SyntaxError: missing ; before statement fonctions.js:1 
  SyntaxError: missing ; before statement villes.js:1 
  ReferenceError: initialisation is not defined index.html:1
  </code></pre>
  
  <p>Any idea what I could have done wrong ?
  Thanks in advance :)</p>
  
  <p>My code : </p>
  
  <p>index .html
      
      </p>
  
  <pre><code>    &lt;head&gt;
  
          &lt;link rel="stylesheet" href="style.css" /&gt;
          &lt;title&gt;Les dés de Monique&lt;/title&gt;
          &lt;meta charset="utf-8" /&gt;
          &lt;meta name="viewport" content="initial-scale=1.0, user-scalable=no" /&gt;
          &lt;meta http-equiv="content-type" content="text/html; charset=UTF-8" /&gt;
          &lt;script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false" &gt;&lt;/script&gt;
          &lt;script type="text/javascript" src="./initialisation.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript" src="./variables.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript" src="./fonctions.js"&gt;&lt;/script&gt;
              &lt;script type="text/javascript" src="./villes.js"&gt;&lt;/script&gt;
  
  
      &lt;/head&gt;
  
  
      &lt;body onload="initialisation()"&gt;
  
              &lt;div id="panel"&gt;
                  &lt;input id="address" type="textbox" value="Bains de Bretagne, France"&gt;
                  &lt;input type="button" value="Ajouter" onclick="coderadresse()"&gt;
              &lt;/div&gt;
  
          &lt;div id="map_canvas" style="width: 100%; height: 100%;"&gt;&lt;/div&gt;
      &lt;/body&gt;
  
  
  
  &lt;/html&gt;
  </code></pre>
  
  <p>variables .js</p>
  
  <pre><code>var geocoder = new google.maps.Geocoder();
  var map;
  var latlng = new google.maps.LatLng(46.1100, 2.1939);
  var bounds;
  
  
  var myOptions = 
  {
      //Controles de l'utilisateur
      keyboardShorcuts: true,
      draggable: true,
      scrollwheel: true, 
      disableDoubleClickZoom: true,
      disableDefaultUI:true,
  
  
      //Affichage (ou non) des boutons
      navigationControl: true,
      mapTypeControl: true,
      zoomControl: true,
      panControl: true,
      overviewMapControl: false,
      rotateControl: false,
      scaleControl: false, 
      streetViewControl: false,
      center: latlng,
  
  
      mapTypeId: google.maps.MapTypeId.TERRAIN    
  };
  
  var styles = 
  [
      {
              featureType: "localities",
              elementType: "labels",
              stylers: 
              [
                  { 
                      visibility: "off" 
                  }
              ]
      },
      {
              featureType: "road",
              stylers: 
              [
                  { 
                      visibility: "off" 
                  }
              ]
      }
  ];
  </code></pre>
  
  <p>villes .js</p>
  
  <pre><code>var villes = 
  [
  "Tirana",
  "Berlin",
  "Andorre-la-Vieille",
  "Vienne",
  "Bruxelles",
  "Minsk",
  "Sarajevo",
  "Sofia",
  "Nicosie",
  "Zagreb",
  "Copenhague",
  "Madrid",
  "Tallinn",
  "Helsinki",
  "Paris",
  "Athènes",
  "Budapest",
  "Dublin",
  "Reykjavik",
  "Rome",
  "Riga",
  "Vaduz",
  "Vilnius",
  "Luxembourg",
  "Skopje",
  "La Valette",
  "Chisinau",
  "Monaco",
  "Podgorica",
  "Oslo",
  "Amsterdam",
  "Varsovie",
  "Lisbonne",
  "Prague",
  "Bucarest",
  "Londres",
  "Moscou",
  "Belgrade",
  "Bratislava",
  "Ljubljana",
  "Stockholm",
  "Berne",
  "Kiev",
  ]
  
  var coordonneesvilles = 
  [
  new google.maps.LatLng(41.33165, 19.83179999999993),
  new google.maps.LatLng(52.519171, 13.406091199999992),
  new google.maps.LatLng(42.50631740000001, 1.521835499999952),
  new google.maps.LatLng(48.2081743, 16.37381890000006),
  new google.maps.LatLng(50.8503396, 4.351710300000036),
  new google.maps.LatLng(53.9, 27.56666670000004),
  new google.maps.LatLng(43.8562586, 18.413076300000057),
  new google.maps.LatLng(42.6978388, 23.32166970000003),
  new google.maps.LatLng(35.1666667, 33.366666699999996),
  new google.maps.LatLng(45.8130293, 15.977894900000024),
  new google.maps.LatLng(55.6760968, 12.568337100000008),
  new google.maps.LatLng(40.4167754, -3.7037901999999576),
  new google.maps.LatLng(59.43696079999999, 24.75357459999998),
  new google.maps.LatLng(60.17332440000001, 24.941024800000037),
  new google.maps.LatLng(48.856614, 2.3522219000000177),
  new google.maps.LatLng(37.9837155, 23.72930969999993),
  new google.maps.LatLng(47.497912, 19.04023499999994),
  new google.maps.LatLng(53.3498053, -6.260309699999993),
  new google.maps.LatLng(64.13533799999999, -21.89521000000002),
  new google.maps.LatLng(41.8929163, 12.482519899999943),
  new google.maps.LatLng(56.9496487, 24.10518639999998),
  new google.maps.LatLng(47.14136999999999, 9.520700000000033),
  new google.maps.LatLng(54.6871555, 25.279651400000034),
  new google.maps.LatLng(49.815273, 6.129583000000025),
  new google.maps.LatLng(41.9973462, 21.42799560000003),
  new google.maps.LatLng(35.89779, 14.51410599999997),
  new google.maps.LatLng(47.02685899999999, 28.84155099999998),
  new google.maps.LatLng(43.73841760000001, 7.42461579999997),
  new google.maps.LatLng(42.442575, 19.26864599999999),
  new google.maps.LatLng(59.9138688, 10.752245399999993),
  new google.maps.LatLng(52.3702157, 4.895167899999933),
  new google.maps.LatLng(52.2296756, 21.012228700000037),
  new google.maps.LatLng(38.7252993, -9.150036399999976),
  new google.maps.LatLng(50.0755381, 14.43780049999998),
  new google.maps.LatLng(44.4325, 26.103888900000015),
  new google.maps.LatLng(51.51121389999999, -0.11982439999997041),
  new google.maps.LatLng(55.7512419, 37.6184217),
  new google.maps.LatLng(44.8205556, 20.462222200000042),
  new google.maps.LatLng(48.1458923, 17.107137299999977),
  new google.maps.LatLng(46.05645089999999, 14.50807020000002),
  new google.maps.LatLng(59.32893000000001, 18.064910000000054),
  new google.maps.LatLng(46.9479222, 7.444608499999958),
  new google.maps.LatLng(50.4501, 30.523400000000038),
  ]
  </code></pre>
  
  <p>initialisation .js</p>
  
  <pre><code>//Fonction d'initialisation de la carte, selon des valeurs précisées
  function initialisation() 
  {
     map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
     centrercarte();
     placermarqueurs();
  }
  </code></pre>
  
  <p>fonctions .js</p>
  
  <pre><code>function centrercarte()
  {
      bounds = new google.maps.LatLngBounds();
  
  
      for (var i = 0 ; i &lt; coordonneesvilles.length ; i++)
      {
  
          bounds.extend(coordonneesvilles[i]);
      }
  
      map.fitBounds(bounds);
  }
  
  function placermarqueurs()
  {
      for (var i = 0 ; i &lt; coordonneesvilles.length ; i++)
      {
  
  
              var optionsmarqueur =
              {
                  position: coordonneesvilles[i],
                  map: map,
                  draggable: false,
                  clickable:false,
                  title:villes[i],
               }
  
  
           var marqueurville = new google.maps.Marker(optionsmarqueur);
      }
   }
  
  
  function coderadresse() 
  {
      var address = document.getElementById('address').value;
  
      geocoder.geocode( { 'address': address}, function(results, status)
      {
      if (status == google.maps.GeocoderStatus.OK) 
      {
  
        //Cette partie là devient inutile si on rafraichit la carte par redirections successives.  
        map.setCenter(results[0].geometry.location);
        var marker = new google.maps.Marker(
        {
            map: map,
            position: results[0].geometry.location
  
        });
  
  
        envoyerdonnees(address, results[0].geometry.location);
  
       } 
  
       else 
       {
        alert('Désolé, le géocodage a échoué... ( ' + status + ')');
       } 
    });
  }
  
  function envoyerdonnees(nom, coordonnees)
  {
      nom = ("\""+nom+"\", \n");
      coordonnees = ("new google.maps.LatLng"+coordonnees+", \n");    
  
      //redirection vers la fonction de traitement de fichier
      document.location.href=("./traitementfichier.php?nom="+nom+"&amp;coordonnees="+coordonnees); 
   }
  </code></pre>