JavaScript(JS)是一种具有函数优先特性的轻量级、解释型或者说即时编译型的编程语言。虽然作为 Web 页面中的脚本语言被人所熟知,但是它也被用到了很多非浏览器环境中,例如 Node.js、Apache CouchDB、Adobe Acrobat 等。进一步说,JavaScript 是一种基于原型、多范式、单
了解更多并加入 MDN Web Docs 社区。 函数 上一页 下一页 函数是 JavaScript 中的基本组件之一。JavaScript 中的函数类似于过程——一组执行任务或计算值的语句。但要成为函数,这个过程应该接受输入并返回与输入存在某些明显关系的输出。要使用一个函数,你必须将其定义在你希望调用它的作用域内。 参见JavaScript ...
JavaScript 内置了一个包含一系列对象的标准库,比如数组(Array),日期(Date),数学(Math)和一组核心的语言元素,包括运算符,流程控制符以及语句等。JavaScript 的核心部分可以通过补充额外的对象来扩展语言以适应不同用途;例如: 客户端的 JavaScript 通过提供控制浏览器及其文档对象模型(DOM)的对象来扩展语言核心。例如:客...
在全局范围中的其他对象,要么是用户自己创建的,要么是宿主应用提供的。宿主应用提供的全局对象,将在API 参考中列出。要想了解更多关于DOM和JavaScript之间的区别,请参考JavaScript 技术概述。 标准全局对象(按类型) 常量属性 表示一个简单的值的全局属性。
参考:https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Operators/this 值: 当前执行上下文(global、function 或 eval)的一个属性,在非严格模式下,总是指向一个对象,在严格模式下可以是任意值。 描述: 1. 全局上下文 无论是否在严格模式下,在全局执行环境中(在任何函数体外部)this都指向全局对...
The MDN Web Docs site provides information about Open Web technologies including HTML, CSS, and APIs for both Web sites and progressive web apps.
The MDN Web Docs site provides information about Open Web technologies including HTML, CSS, and APIs for both Web sites and progressive web apps.
Scheme-relative URL Origin-relative URL Directory-relative URL Directory-relative URL Parent-directory-relative URL Result playLinking to an element on the same page htmlCopy to Clipboardplay <!-- element links to the section below --> Jump to the heading below <!-- ...
Expando properties are properties added to DOM nodes with JavaScript, where those properties are not part of the object's DOM specification:
Serializing DOM trees into XML strings: XMLSerializer Parsing XML or HTML into DOM trees: DOMParser HTMLElement.outerTextHelp improve MDN Was this page helpful to you? YesNoLearn how to contribute. This page was last modified on Jul 12, 2024 by MDN contributors. View this page on GitHub ...