24 get data using javascript

Solutions on MaxInterview for 24 get data using javascript by the best coders in the world

showing results for - " 24 get data using javascript"
Roland
22 Feb 2016
1function $_GET(q,s) {
2    s = (s) ? s : window.location.search;
3    var re = new RegExp('&'+q+'=([^&]*)','i');
4    return (s=s.replace(/^\?/,'&').match(re)) ?s=s[1] :s='';
5}
6
7console.log($_GET("myvariable"));