Hello! need little help
i need script that detect user device than ridirect to apropriate domain.
example:
if PC than go to www.domain.com
if mobile than go to www.mob.domain.com or www.domain.com/mob
web is html but I asume index need to be php which rederect
i found this one
and if there is some better way please tell me
You can use JS too. Just set the screen width less than or equal to and the redirect location.
<script type="text/javascript">
<!--
if (screen.width <= 320) {
document.location = "mobile.html";
}
//-->
</script>
thanks! this looks realy simple! 
but seams that is not working if its just that code
iKreativ said
You can use JS too. Just set the screen width less than or equal to and the redirect location.<script type="text/javascript"> <!-- if (screen.width <= 320) { document.location = "mobile.html"; } //--> </script>
This is perhaps one of the sloppiest piece of code i’ve seen.
use this instead: http://code.google.com/p/php-mobile-detect/ there’s always a way around this method, but it works perfectly.
proxdeveloper said
iKreativ said
You can use JS too. Just set the screen width less than or equal to and the redirect location.<script type="text/javascript"> <!-- if (screen.width <= 320) { document.location = "mobile.html"; } //--> </script>This is perhaps one of the sloppiest piece of code i’ve seen.
use this instead: http://code.google.com/p/php-mobile-detect/ there’s always a way around this method, but it works perfectly.
Well go tell Chris Coyier of CSS Tricks, it’s his code. I use my own PHP script.
proxdeveloper said
iKreativ said
You can use JS too. Just set the screen width less than or equal to and the redirect location.<script type="text/javascript"> <!-- if (screen.width <= 320) { document.location = "mobile.html"; } //--> </script>This is perhaps one of the sloppiest piece of code i’ve seen.
use this instead: http://code.google.com/p/php-mobile-detect/ there’s always a way around this method, but it works perfectly.
Thanks!
I will test that option to
