JavaScript和__proto__ - 什么浏览器使用它? [英] JavaScript and __proto__ - what browsers use it?

查看:215
本文介绍了JavaScript和__proto__ - 什么浏览器使用它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

哪些网络浏览器使用 __ proto __ Mozilla声明

What web browsers use the __proto__? Mozilla states that:

请注意 __ proto __ 可能不适用于Mozilla以外的JavaScript版本。

Note that __proto__ may not be available in JavaScript versions other than that in Mozilla.


推荐答案

点击这里为您的答案。

详细信息

最通用的方法是在不同的浏览器中测试此页面:

The most general way would be to test this page in different browsers:

<html>
  <head>
    <script type="text/javascript">
      function a() {}
      if ( (new a).__proto__ === a.prototype )
          alert('supported');
    </script>

  </head>
</html>

如果浏览器支持 __ proto __ ,它会发出警告。我已将其提交给 browsershots.org ,这将创建截图许多不同浏览器中的页面。因此,您应该通过警报消息看到哪个浏览器支持它。

It alerts if a browser supports __proto__. I've submitted it to browsershots.org, which will create screenshots of the page in many different browsers. Thus, you should see--by means of the alert message--which browser does support it.

这篇关于JavaScript和__proto__ - 什么浏览器使用它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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