redirect PS3 via user agent

前端 未结 1 1944
野的像风
野的像风 2021-01-29 10:35

I want users to be redirected to a different webpage if they are using a PS3

here is the code I have been trying to use



        
相关标签:
1条回答
  • 2021-01-29 10:47

    You could try something like this:

    <script language=javascript>
        var uAgent = navigator.userAgent;
       if (uAgent.indexOf("PLAYSTATION") != -1) {
          window.location = ("http://example.com");
       }
    </script>
    

    It may be easier to attempt to do this server side as well (C# ex below)

      if (Request.UserAgent.ToUpper().Contains("PLAYSTATION"))
          //Send to correct page
          Response.Redirect("http://www.example.com/");
      }
    
    0 讨论(0)
提交回复
热议问题