Advertisement
Guest User

Untitled

a guest
Jul 29th, 2015
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. var getURLParameters = function(url) {
  2. var result = {};
  3. var searchIndex = url.indexOf("?");
  4.  
  5. if (searchIndex == -1 ) return result;
  6. var sPageURL = url.substring(searchIndex +1);
  7. var sURLVariables = sPageURL.split('&');
  8. for (var i = 0; i < sURLVariables.length; i++) {
  9. var sParameterName = sURLVariables[i].split('=');
  10. result[sParameterName[0]] = sParameterName[1];
  11. }
  12. return result;
  13. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement