$.request = function (name) { var search = location.search.slice(1); var arr = search.split("&"); for (var i = 0; i < arr.length; i++) { var ar = arr[i].split("="); if (ar[0] == name) { if (unescape(ar[1]) == ‘undefined‘) { return ""; } else { return unescape(ar[1]); } } } return ""; }