/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function request(value) { var queryStr = location.href.split('?'); if (queryStr.length < 2){ return ""; } var requestObj = {}; var level1 = []; level1 = queryStr[1].split('&'); for (var i = 0; i < level1.length; i++) { level2 = level1[i].split('='); requestObj[level2[0]] = level2[1]; } return decodeURIComponent(requestObj[value]); }