From: Steve Sutton Date: Tue, 18 Nov 2014 20:54:53 +0000 (-0500) Subject: correct path X-Git-Tag: v1.0.0~76 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=1f3a5c75dce8f112e64a601c026ed96cace0a820;p=WP-Themes%2FPrestonFeather.git correct path --- diff --git a/js/google-map.js b/js/google-map.js index 13d4746..8a3141a 100644 --- a/js/google-map.js +++ b/js/google-map.js @@ -19,8 +19,10 @@ var Map = { Map._map = new google.maps.Map(canvas, myOptions); Map._latLngBounds = new google.maps.LatLngBounds(); Map._infoWindow = new google.maps.InfoWindow; - - $.get("http://localhost/WordPress/preston/wp-content/plugins/glm-google-map/map.xml", Map._loadData, 'xml'); + var scripts= document.getElementsByTagName('script'); + var path= scripts[scripts.length-1].src.split('?')[0]; // remove any ?query + var mydir= path.split('/').slice(0, -1).join('/')+'/'; // remove last filename part of path + $.get(mydir + "map.xml", Map._loadData, 'xml'); }, _loadData: function(data)