javascript和DOM有什么区别? [英] What is the difference between javascript and DOM?

查看:133
本文介绍了javascript和DOM有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

JavaScript和DOM有什么区别? id DOM与firefox有关? DOM只是HTML元素的源代码?

What is the difference between JavaScript and DOM? id DOM related to firefox? is DOM just a source order of HTML elements?

推荐答案

DOM代表文档对象模型,正如你可以从名称中猜出的,以独立于平台/浏览器的方式表示HTML / XML文档的结构。 DOM还提供了一个API来操纵DOM,其功能类似于 getElementsByTagName createElement

DOM stands for Document Object Model and, as you could guess from the name, represents the structure of an HTML/XML document in a platform/browser independent way. The DOM also provides an API to manipulate the DOM, with functions like getElementsByTagName and createElement.

JavaScript 是一种网络浏览器可以执行的编程语言。 JavaScript可以通过 DOM脚本与DOM进行交互。

JavaScript is a programming language that web browsers can execute. JavaScript can interact with the DOM with DOM scripting.

编辑在评论中回答您的问题:例如,浏览器会连同任何引用的JS和CSS(以及图像,Flash等)一起下载HTML。浏览器从HTML构造DOM,并使用CSS中指定的规则进行渲染。当页面加载时,JS可能会操纵DOM,当用户执行某些操作时,或者任何其他事件发生。当DOM更改时,浏览器会更新显示的内容。

Edit to answer your question in a comment: For example, the browser downloads the HTML along with any referenced JS and CSS (and images, Flash etc.). The browser constructs the DOM from the HTML and renders it using the rules specified in the CSS. JS may manipulate the DOM when the page loads, when the user does something, or when any other event happens. When the DOM changes the browser updates what is displayed.

这篇关于javascript和DOM有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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