Skip to content

This code parses the variables in a link, usually used by PHP using javascript and adds them to the object window.location.variables

Notifications You must be signed in to change notification settings

andrewgrider/JavaScript-URL-Variable-Parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

JavaScript URL Variable Parser

Written in vanilla JavaScript, This code allows you to take a link & extract the PHP variables at the end of the url, parses them, then stores each variable individually in the window.location.variables object.

For an example, a link like "https://wwww.example.com/?token=123abc456def&mobile=true", window.link.variables would return:

{
  token : "123abc456def",
  mobile : true;
}

About

This code parses the variables in a link, usually used by PHP using javascript and adds them to the object window.location.variables

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published