Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: Patony Toth
Added: Dec 6, 2018 9:31 PM
Modified: Dec 6, 2018 9:35 PM
Views: 2
source: https://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript
base documentation: https://www.w3schools.com/js/js_window_location.asp
  1. function getParameterByName(name) {
  2.     var match = RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search);
  3.     return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
  4. }
  5.