javascript - redirect PS3 via user agent -
i want users redirected different webpage if using ps3
here code have been trying use
<script language=javascript> <!-- if ((navigator.useragent.match(/imozilla/i)) || (navigator.useragent.match(/iplaystation 3/i))) { location.replace("http://example.com"); } --> </script>
a list of user agents ps3 can found here http://www.useragentstring.com/pages/playstation%203/
i cant seem work doing wrong?
you try this:
<script language=javascript> var uagent = navigator.useragent; if (uagent.indexof("playstation") != -1) { window.location = ("http://example.com"); } </script>
it may easier attempt server side (c# ex below)
if (request.useragent.toupper().contains("playstation")) //send correct page response.redirect("http://www.example.com/"); }
Comments
Post a Comment