js加载页面

// 用 document.readyState == "complete" 判断页面是否加载完成。
 document.onreadystatechange = function(){
     if(document.readyState=="complete")
     {
         alert('加载完毕');
     }
 }
//php中js加载页面

 echo "<script>self.location='index.php'</script>";

//php中js返回上一页并刷新页面

echo "<script>self.location=document.referrer</script>";
原文地址:https://www.cnblogs.com/sontan/p/7026851.html