javascript - 为何navigator.appName的值都是netscape?

查看:150
本文介绍了javascript - 为何navigator.appName的值都是netscape?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

我的firefox chrome opera 运行
navigator.appName
"Netscape"
navigator.appCodeName
"Mozilla"
为何输出结果都一样?他们的内核是不同的哈

解决方案

The NavigatorID.appName property returns the name of the browser. The HTML5 specification also allows any browser to return "Netscape" here, for compatibility reasons.

Note: Do not rely on this property to return the correct browser name. In most browsers (like Firefox, Chrome, Safari, Opera and Internet Explorer) the returned string is "Netscape".

有问题,先查资料,百度找不到就找MDN,MDN找不到就Google,Google找不到就翻规范,还找不到的话确实可以上社区提问了,而且相信这个问题无论对提问者还是回答者都会是很好的帮助。

这篇关于javascript - 为何navigator.appName的值都是netscape?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆