Skip to content

Commit 9f49739

Browse files
committed
Independent method testing
1 parent 2bef9c4 commit 9f49739

File tree

4 files changed

+41
-26
lines changed

4 files changed

+41
-26
lines changed

dist/js/jquery.storelocator.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! jQuery Google Maps Store Locator - v1.4.9 - 2014-09-13
1+
/*! jQuery Google Maps Store Locator - v1.4.9 - 2014-09-14
22
* http://www.bjornblog.com/web/jquery-store-locator-plugin
33
* Copyright (c) 2014 Bjorn Holine; Licensed MIT */
44

@@ -233,13 +233,15 @@
233233
* Check for query string
234234
*
235235
* @param param {string} query string parameter to test
236-
* @returns {string}
236+
* @returns {string} query string value
237237
*/
238238
getQueryString: function(param) {
239-
param = param.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
240-
var regex = new RegExp('[\\?&]' + param + '=([^&#]*)'),
239+
if(param) {
240+
param = param.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
241+
var regex = new RegExp('[\\?&]' + param + '=([^&#]*)'),
241242
results = regex.exec(location.search);
242-
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
243+
return (results === null) ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
244+
}
243245
},
244246

245247
/**
@@ -269,8 +271,8 @@
269271
_this.locator();
270272

271273
}, function () {
272-
// KML templates not loaded - you can add a console.log here to see if your templates are failing
273-
274+
// KML templates not loaded
275+
alert('Error: could not load plugin templates');
274276
});
275277
}
276278
// Handle script tag template method
@@ -304,8 +306,8 @@
304306
_this.locator();
305307

306308
}, function () {
307-
// JSON/XML templates not loaded - you can add a console.log here to see if your templates are failing
308-
309+
// JSON/XML templates not loaded
310+
alert('Error: could not load plugin templates');
309311
});
310312
}
311313
},

0 commit comments

Comments
 (0)