Get Query String Args Javascript


/ Published in: JavaScript
Save to your folder(s)

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


Copy this code and paste it in your HTML
  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. }

URL: http://www.itsgotto.be/cv.php

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.