Hello,

I want to do a redirect depending if tablets are in landscape or portrait mode.

I want before the redirection to display a short message (i use document.write). When i am in portrait mode, message is displayed but redirection never finished.

Thanks for help

Code:
<?php
if (!isset($_COOKIE["Mobile"])){header("Location: http://monsite.net/message.php");}
?>
<script type="text/javascript">
function mediaqueryresponse(mql){
if (mql.matches){
<!--
function Redirect()
{
window.location="http://mobile.monsite.net";
}
document.write("... Redirection en cours vers la version Smartphone ...");
setTimeout('Redirect()', 2000);
//-->
}
else{}
}
var mql = window.matchMedia("(orientation: portrait),screen and (max-device-width: 700px)")
mediaqueryresponse(mql)
mql.addListener(mediaqueryresponse)
</script>