我这段跳转代码总是反复的加载,到底错在哪儿呢?

下面是代码

<script language=javascript>
switch(window.screen.width)
{
case 800 :
window.location.href = "800.html"; break;
case 640 :
window.location.href = "640.html"; break;
case 1024 :
window.location.href = "1024.html"; break;
case 1152 :
window.location.href = "1152.html"; break;
case 1280 :
window.location.href = "1280.html"; break;
case 1366 :
window.location.href = "1366.html"; break;
case 1440 :
window.location.href = "1440.html"; break;
case 1600 :
window.location.href = "default.html"; break;
case 1920 :
window.location.href = "1920.html"; break;
case 2560 :
window.location.href = "2560.html"; break;
default :
window.location.href = "800.html"; break;
}
</script>


加载页面每次都会执行这些js代码,即使不匹配window.screen.width也会走default跳转到800.html,会一直刷新,应该给跳转的网址附带上宽度参数,如果存在参数就不要跳转了

把下面的去掉:

default :
window.location.href = "800.html"; break;