JavaScript组成
2019-03-23 17:29:29 0 举报
AI智能生成
JS基本框架
作者其他创作
大纲/内容
核心 ECMAScript
语法、类型、语句、关键字、保留字、操作符、对象
实现:JavaScript, JScript, ActionScript
版本
第四版废弃了,只接受一小部分功能作为v3.1,其他功能并入到 ES6 中了
BOM
是为了操作浏览器出现的API,window 是其下的一个对象,主要用来控制浏览器的行为
alert(msg), close(), confirm(msg), prompt(label, defaultV), moveTo(), moveBy(), resizeBy(), resizeTo(), open(), blur(), scrollBy(), scrollTo()...
navigator
location
history
frames
cookies
document: 说明 BOM 包括 DOM
XMLHttpRequest
DOM
是为了操作文档出现的API,document 是其下的一个对象
DOM 1级:DOM core, DOM HTML
DOM 2级:DOM视图,DOM事件、DOM样式、DOM遍历和范围
DOM 3级:DOM load and save、DOM Validation、DOM core开始支持 XML Infoset、XPath、XML Base
其他接口:SVG、MathML、SMIL
DOM API
Node
prop
baseURI
childNodes
parentNode, parentElement, firstChild, lastChild, previousSibling, nextSibling
nodeName, nodeType, nodeValue
textContent
method
appendChild()
cloneNode()
contains()
getRootNode(0
hasChildNodes()
insertBefore()
removeChild()
replaceChild()
Document
prop
anchors
documentURI
plugins
cookie
domain
location
referrer
title
URL
method
getElementById(), querySelector(), querySelectorAll()
createAttribute(), createComment(), createElement(), createDocumentFragment(), createEvent(), createTextNode()
clear(), close(), hasFocus(), open()
write(), writeln()
Element
prop
attributes
classList
className
id
tagName
localName
lastElementChild
innerHTML, outerHTML
clientHeight, clientWidth, clientLeft, clientTop
scrollLeft, scrollTop, scrollWidth, scrollHeight
method
attachShadow()
addEventListener(), removeEventListener(), dispatchEvent()
getAttribute(), setAttribute(), toggleAttribute(), removeAttribute()
getAttributeNames()
getAttributeNode()
getElementsByClassName(), getElementsByTagName(), getElementsByTagNameNS(), querySelectorAll(), getElementById(), querySelector()
handler
onwheel
BOM API
0 条评论
下一页