方法有很多种,简单有效的2种:
1. java:
<script type=’text/javascript’>
(function()
{
if( window.localStorage )
{
if( !localStorage.getItem( ‘firstLoad’ ) )
{
localStorage[ ‘firstLoad’ ] = true;
window.location.reload();
}
else
localStorage.removeItem( ‘firstLoad’ );
}
})();
</script>
2. html 代码 (可以添加到header 里)
<body onload="if (location.href.indexOf('reload')==-1) {location.replace(location.href+'?reload')}">