Created
August 9, 2015 09:08
-
-
Save jumplee/a85dbc37cab2d05ce628 to your computer and use it in GitHub Desktop.
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
| function getParam(param){ | |
| var url=location.href; | |
| var reg =new RegExp(param+'=(.*)'); | |
| var index=url.indexOf('?'); | |
| var param_str=url.substr(index); | |
| var paramArray=reg.exec(param_str); | |
| if(paramArray.length==2){ | |
| return paramArray[1]; | |
| }else{ | |
| return ''; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment