/* javascript */ String.prototype.get = function(p){ return(this.match(new RegExp("[?|&]?" + p + "=([^&]*)"))[1]); } /* test: yourfile.html?test=test234 alerts: test234 */ alert(window.location.search.get('test'));
You need to create an account or log in to post comments to this site.
this looks better :) thanks for your snippet.. useful for me ;)