隐藏url中参数的方法可以通过创建一个虚拟的form表单来解决
/**
* 新窗口打开页面
* newWindowPage(params1,params2,....)
*
* */
function newWindowPage() {
//创建一个临时的form表单
var tempForm = document.createElement("form");
tempForm.id = "tempForm1";
tempForm.method = "post";
tempForm.action = "你的url";
//新窗口打开
tempForm.target = "_blank";
//创建input设置参数
for(var i in arguments) {
var hideInput = document.createElement("input");
hideInput.type = "hidden";
//params 以 - 连接
hideInput.name = arguments[i].split('-')[0];
hideInput.value = arguments[i].split('-')[1];
tempForm.appendChild(hideInput);
}
//将此form表单添加到页面主体body中
document.body.appendChild(tempForm);
//手动触发,提交表单
tempForm.submit();
//从body中移除form表单
document.body.removeChild(tempForm);
}