var g="data"; var s="2.html?".replace("2.html?","2.html")+escape(g); location.href=s; var d=location.search; alert(s);