Posted By

brownrl on 09/23/11


get browser String query

Versions (?)

Get Query String Args Javascript

 / Published in: JavaScript


This will get the arguments on the query string and put them into a handy array.

  1. function getUrlVars()
  2. {
  3. var vars = {};
  4. var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
  5. vars[key] = value;
  6. });
  7. return vars;
  8. }

Report this snippet  


RSS Icon Subscribe to comments
Posted By: JonyGreen on December 7, 2015

i find a free online tool to minify javascript.

Posted By: JonyGreen on December 7, 2015

you can try this free online javascript compressor to reduce your js file size.

You need to login to post a comment.