Read the GET variables in url (JQuery)

How to get the GET variable from URL with jQuery

var split = location.search.replace('?', '').split('&').map(function(val){
  return val.split('=');
});

Now it is saved in array named – split. You can easily access variable name by split[index][0] and value by split[index][1].

Leave a Reply

Your email address will not be published.