开发者

How do I do this with the user agent?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜