javascript - Grab url parameter with jquery and put into input -
i trying grab specific paramater url such www.internets.com?param=123456
i trying this..
$j.extend({ geturlvars: function(){ return window.location.href.slice(window.location.href.indexof('?')).split(/[&?]{1}[\w\d]+=/); } }); var allvars = $j.geturlvars('param');
the weird thing variable returning comma in example looks ,123456
where coming from?!
split
returns array of substrings, comma coming serialization of array.
Comments
Post a Comment