/ Published in: JavaScript

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/* Parse GET parameters (based on http://www.netlobo.com/url_query_string_javascript.html) */ function parseHttpGet(key){ key = key.replace(/[[]/,"\[").replace(/[]]/,"\]"); var regexS = "[\?&]"+key+"=([^&#]*)"; var regex = new RegExp( regexS ); var results = regex.exec(window.location.href); return ( results != null ? results[1] : false ); }
Comments
