获取url地址除去?后的链接地址
var url = "12345.htm?x=666&y=777"; if(url.indexOf("?") != -1) { url = url.split("?")[0]; console.log(url); }