什么是预定义的原始构造函数? [英] What are the predefined primitive constructors?

查看:105
本文介绍了什么是预定义的原始构造函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在浏览器体验中,编程构造函数用于在该环境中生成工件。

In a browser experience, programmed constructors are used to generate artifacts in that environment.


  • 是否有所有预定义的综合列表原始构造函数?

  • 某些构造函数是否对特定浏览器(Chrome,Opera,Safari,...)是唯一的?

  • 每个构造函数的参数类型,浏览器中的顺序和含义相同?

例如使用FireFox:

Using FireFox for instance:

javascript:
  alert([
    "using browser environment:  \n"+window.navigator.userAgent,
      new Array(), new Boolean(), new Date(), new Function(),
        new Number(), new Object(), new RegExp(), new String(),
          new Error(), new Image(), new Option(),
     ] . join("\n\n"));

生成:(具有空白内容的文物是不可见的)

generates: (artifacts with vacuous content are invisible)


使用浏览器环境:

Mozilla / 5.0(X11; U; Linux i686; en-US; rv:1.9.2.3)Gecko / 20100423 Ubuntu / 10.04(清晰度)Firefox / 3.6.3

using browser environment:
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.3) Gecko/20100423 Ubuntu/10.04 (lucid) Firefox/3.6.3

 

false

2011年8月5日星期五11:25:15 GMT-0400(美国东部时间)

Fri Aug 05 2011 11:25:15 GMT-0400 (EST)

功能匿名(){}

0

[object Object]

[object Object]

/(?:)/

 

错误

[object HTMLImageElement]

[object HTMLImageElement]

[object HTMLOptionElement]

[object HTMLOptionElement]

FireFox还有哪些基本构造函数,如果任何?

What other elementary constructors does FireFox have, if any?

参考:

所有Javasc的文档在哪里ript HTML Element Constructors?

构造函数在哪里,例如`new Image()`和`new Option()`,记录在哪里?

以下缺少的参考文献是疏忽。感谢 TeslaNick的答案,以促使他们加入。

全局对象构造函数 - MDN文档
b $ b 构造函数 - MDN文档

references:
Where is the Documentation for all of the Javascript HTML Element Constructors?
Where are constructors such as, `new Image()` and `new Option()`, documented?
The following missing references were an oversight. Thanks to TeslaNick's answer for prompting their inclusion.
Global Object constructors - MDN Docs
constructor - MDN Docs

推荐答案

Javascript上的Mozilla开发人员中心是核心javascript构造函数的通用参考点。 DOM参考部分包含许多特定于浏览器环境的内容。

The Mozilla Developer Center on Javascript is a common reference point for core javascript constructors. The DOM Reference section contains a lot of the stuff specific to the browser environment.

整个MDC的各个部分都有更多的构造函数。 SVG,XUL,Canvas,WebGL等都有自己的API并公开自己的对象。

There are more constructors, documented in various sections throughout the MDC. SVG, XUL, Canvas, WebGL, and others all have their own APIs and expose their own objects.

这篇关于什么是预定义的原始构造函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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