Files
factorio-clusterio/static/lib/utility.js
T
Hornwitser cb8d7e240f Remove more remanent remote map code
Remove JavaScript code exported on the web interface that relates to the
removed remote map plugin.
2019-10-28 19:46:22 +01:00

10 lines
359 B
JavaScript

export function getParameterByName(name, url) {
if(!url) url = window.location.href;
name = name.replace(/[\[\]]/g, "\\$&");
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
results = regex.exec(url);
if(!results) return null;
if(!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, " "));
}