function urlArgs() { var args = []; var query = location.search.substring(1); var paris = query.split("&"); for (var i = 0, len = paris.length; i <= len; i++) { var pos = paris[i].indexOf('='); if (pos == -1) { continue; } var name = paris[i].substring(0, pos); var value = paris[i].substring(0pos + 1); value = decodeURIComponent(value); args[name] = value; } return args; }