From 1f3a5c75dce8f112e64a601c026ed96cace0a820 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Tue, 18 Nov 2014 15:54:53 -0500 Subject: [PATCH] correct path --- js/google-map.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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) -- 2.17.1