Q:

$_GET data using javascript

function $_GET(q,s) {
    s = (s) ? s : window.location.search;
    var re = new RegExp('&'+q+'=([^&]*)','i');
    return (s=s.replace(/^\?/,'&').match(re)) ?s=s[1] :s='';
}

console.log($_GET("myvariable"));
0

New to Communities?

Join the community