ajax 或者get 请求 发送后 成功给个提示 不想跳转
直接上代码:
<button id="btn" onclick="tan()">btn</button>
function tan(e) {
var layer=document.createElement("div");
layer.innerHTML=e
layer.id="layer";
var style=
{
background:"#ccc",
position:"absolute",
zIndex:10,
width:"200px",
height:"50px",
left:"50%",
bottom:"5%",
color:"white",
"text-align":"center",
"font-size":20,
"padding-top":"20px"
}
for(var i in style)
layer.style[i]=style[i];
if(document.getElementById("layer")==null)
{
document.body.appendChild(layer);
setTimeout("document.body.removeChild(layer)",2000)
}
}