本范例演示了JS如何获取当前url和url参数的获取
function getUrlParm( name ) { var regexS = "[\\?&]"+name+"=([^&#]*)" ; var regex = new RegExp( regexS ) ; var tmpURL = window.location.href ; var results = regex.exec( tmpURL ) ; if( results == null ) { return "" ; } else { return results[1] ; } }