JavaScript-第一步
学习javascript之前,你需要先掌握html和css,javascript要比html和css难多了,熟悉html和css对学习javascript也有很大的帮助。
什么是JavaScript,我们用JavaScript能做什么?
我们先从一个高的层次来看javascript, 来了解javascript的目的。
JavaScript is case sensitive, and very fussy, so you need to enter the syntax exactly as shown, otherwise it may not work.
什么是JavaScript,我们用JavaScript能做什么?
我们先从一个高的层次来看javascript, 来了解javascript的目的。
JavaScript is case sensitive, and very fussy, so you need to enter the syntax exactly as shown, otherwise it may not work.
HTML
CSS
JAVASCRIPT
三层组合成web page
Browser APIs are built into your web browser, 浏览器API可以expose data from the surrounding computer environment.
DOM API( Document Object Model) ,允许你manipulate HTML and CSS, creating, removing and change HTML, dynamically applying new styles to your page, etc. Every time you see a popup window appear on a page, or some new content displayed(as we saw above in our simple demo) for example, that's the DOM in action.
CSS
JAVASCRIPT
三层组合成web page
Browser APIs are built into your web browser, 浏览器API可以expose data from the surrounding computer environment.
DOM API( Document Object Model) ,允许你manipulate HTML and CSS, creating, removing and change HTML, dynamically applying new styles to your page, etc. Every time you see a popup window appear on a page, or some new content displayed(as we saw above in our simple demo) for example, that's the DOM in action.
- Geolocation API
- Fetch API
- Canvas and WebGL API
- Audio and Video API
- Notifications API
- Vibration API
- Web Storage API
- IndexedDB API
如果javascript修改html和css,而html和css又没有load,那么就会出错。
浏览器安全
每个tab都有它自己的bucket for running code(buckets are called "execution environments" 执行环境)。 大多数情况下每个tab是独立的。
If this were not the case, then pirates(盗窃者) could start writing code to steal information from other websites, and other such bad things.
也有几种方式可以再不同的websites/tabs中传递数据,这属于高级技术。
JavaScript running order
浏览器遇到一个javascript代码块,浏览器会顺序执行,那就是说你需要注意代码的顺序。
Interpreted versus compiled code
From a technical standpoint, most modern JavaScript interpreters actually use a technique called just-in-time compiling to imporve performance;
JavaScript is still considered an interpreted language, since the compilation is handled at run time, rather than ahead of time.
JavaScript仍然被认为是一种解释语言,因为编译是在运行时处理的,而不是提前处理的。
服务器-side还是客户-side
run on server or run on the user's computer
阅读量: 543
发布于:
修改于:
发布于:
修改于: