function GetUrlParms(parmsName) { var parms = window.location.href.split('?')[1]; if (parms == null || parms == "") return; var arr = parms.split('&'); if (arr.length > 1) { for (var i = 0; i < arr.length; i++) { var name = arr[i].substring(0, arr[i].indexOf("=")); if (name == parmsName) { var begin = arr[i].indexOf("="); var end = arr[i].length; alert(arr[i].substring(begin + 1, end)); return arr[i].substring(begin + 1, end); } } } else { var begin = parms.indexOf("="); var end = parms.length; alert(parms.substring(begin + 1, end)); return parms.substring(begin + 1, end); } }