Forum Moderators: open
script language="Javascript1.1">
function detect(){
if(screen.width<1024¦¦screen.height<768){
location.href('hi.php');
}else{
location.href('lo.html');
}}
</script>
But I also want to be able to properly allow users with javascript disabled to view the lower end page. Whats the best way to accomplish this?
In fact, this is an important principle, IMO, and not just with scrfeen res. So many scripts try to accommodate every possible situation with an explicit direction, and you often cannot think of everything. It's much better to serve the most common situation by default. I use principle this when I need browser detection, Flash detection, and so on.
<added>
you might want to use the replace() method instead of just reassigning location.href to a new document. That will keep the Back Button from being frustrating for your visitors who have been redirected -- and that will be in the area of 70% as you have set up the logic her.
</added>