开发者

How do I do this with the user agent?

开发者 https://www.devze.com 2022-12-24 12:06 出处:网络
If the user-agent includes the word \"myapp\", then alert(\'hi\'); BTW, 开发者_C百科I am using JQuery.if (navigator.userAgent.indexOf(\"myapp\") !== -1) {

If the user-agent includes the word "myapp", then alert('hi');

BTW, 开发者_C百科I am using JQuery.


if (navigator.userAgent.indexOf("myapp") !== -1) {
  alert("hi");
}

I recommend you don't do user-agent sniffing.

0

精彩评论

暂无评论...
验证码 换一张
取 消