(location)
| 143 | |
| 144 | |
| 145 | function parseSearchParameters(location) { |
| 146 | var parameters = {}, |
| 147 | search = location.search || "?"; |
| 148 | |
| 149 | search.substr(1).split('&').forEach(function (q) { |
| 150 | // skip empty strings |
| 151 | if (!q) { |
| 152 | return; |
| 153 | } |
| 154 | // if there is no '=', have it handled as if given key was set to undefined |
| 155 | var s = q.split('=', 2); |
| 156 | parameters[decodeURIComponent(s[0])] = decodeURIComponent(s[1]); |
| 157 | }); |
| 158 | |
| 159 | return parameters; |
| 160 | } |
| 161 | |
| 162 | |
| 163 | window.onload = function () { |