title: localhost and Javascript
body: <p>My code works fine, but I wanted to clean up the code by putting the entire Javascript in an another file like <code>maps.js</code>. But the line with <code>maps.js</code> is not recognised. Using Firebug, I tried to debug and found out that the GET is failing for this file!</p>
  
  <p>However the GET works for <code>socket.io.js</code>. I am running the system using node.js through localhost:8080. Can anyone tell me what I am doing wrong here? Or where is actually the current working directory when the HTML code is being executed? I even tried the absolute path of <code>maps.js</code>, but didn't have any success.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&gt;
    &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
      &lt;meta type="keywords" content="" /&gt;
      &lt;link href="/maps/documentation/javascript/examples/default.css" rel="stylesheet"&gt;
      &lt;title&gt;ReSense Client&lt;/title&gt;
      &lt;script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3.exp&amp;sensor=false"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="/socket.io/socket.io.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="/js/maps.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript"&gt;
        var socket = io.connect('http://localhost');
        var stockholm = new google.maps.LatLng(59.32522, 18.07002);
        var parliament = new google.maps.LatLng(59.327383, 18.06747);
        var marker;
        var map;
        function initialize() {
          var mapOptions = {
            zoom: 13,
            mapTypeId: google.maps.MapTypeId.ROADMAP,
            center: stockholm
          };
          map = new google.maps.Map(document.getElementById('map_canvas'), mapOptions);
          google.maps.event.addListener(marker, 'click', toggleBounce);
        }
        function toggleBounce() {
          if (marker.getAnimation() != null) {
            marker.setAnimation(null);
          } else {
            marker.setAnimation(google.maps.Animation.BOUNCE);
          }
        }
      &lt;/script&gt;
    &lt;/head&gt;
    &lt;body onload="initialize()"&gt;
      &lt;div id="map_canvas" style="width: 500px; height: 400px;"&gt;map div&lt;/div&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>