setTimeout(location,5000);   //延迟5秒刷新页面  

function location(){
window.location.href = window.location.href;
} //setTimeout(window.location.reload,5000);这样写将立即刷新 不会延迟5秒.