/ Published in: JavaScript
get paramt
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// make GET-Params accessible in JS (function(){ window.getparams = {}; var s = window.location.search.substring(1).split('&'); if(!s.length) return; for(var i = 0; i < s.length; i++) { var parts = s[i].split('='); window.getparams[unescape(parts[0])] = unescape(parts[1]); } }()) //use: window.getparams['id']