Created
August 14, 2020 02:50
-
-
Save johnmurch/75501237a320a4bef86e987d5d7deef3 to your computer and use it in GitHub Desktop.
params
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var myurl = "journey?reference=123&line=A&destination=China&operator=Belbo&departure=1043&vehicle=ARC"; | |
var keyval = myurl.split('?')[1].split('&'); | |
for(var x=0,y=keyval.length; x<y; x+=1) | |
console.log(keyval[x], keyval[x].split('=')[0], keyval[x].split('=')[1]); | |
/* | |
reference=123 reference 123 | |
line=A line A | |
destination=China destination China | |
operator=Belbo operator Belbo | |
departure=1043 departure 1043 | |
vehicle=ARC vehicle ARC | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment