JavaScript基础知识学习二
2009-09-09 16:02
573 查看
一 变量
在函数体内部使用var关键字定义的为本地变量
二 数值
Math.round(), Math.floor(), and Math.ceil()
Math.random()
Math.abs()
toFixed()
parseInt() and parseFloat() 三 字符串
可以使用单引号或双引号,字符串中的引号有必要的话,需要使用转义
String对象可用方法和属性
length,indexOf() and lastIndexOf(),charAt(),substring(),split(),toLowerCase(),toUpperCase()
四 结构控制
if,elseif ,switch(switch必须具有同样的数据类型,类似于===)
for,while,do while,break and continue
try catch finally
五 函数
函数也可以作为变量传递
六 Object
七 事件注册
1 Inline event handlers <a href="somewhere.html" onclick="highlightNavItem()">
2 The traditional model
<a href="somewhere.html" id="somewhere">
var x = document.getElementById('somewhere');
x.onclick = highlightNavItem; // note: no parentheses
3 Executing event handlers directly
x[i].onkeyup = x[i].onchange = checkMaxLength;
x[i].onkeyup();
4 Anonymous functions
5 W3C and Microsoft models
在函数体内部使用var关键字定义的为本地变量
二 数值
Math.round(), Math.floor(), and Math.ceil()
Math.random()
Math.abs()
toFixed()
parseInt() and parseFloat() 三 字符串
可以使用单引号或双引号,字符串中的引号有必要的话,需要使用转义
String对象可用方法和属性
length,indexOf() and lastIndexOf(),charAt(),substring(),split(),toLowerCase(),toUpperCase()
四 结构控制
if,elseif ,switch(switch必须具有同样的数据类型,类似于===)
for,while,do while,break and continue
try catch finally
五 函数
函数也可以作为变量传递
六 Object
七 事件注册
1 Inline event handlers <a href="somewhere.html" onclick="highlightNavItem()">
2 The traditional model
<a href="somewhere.html" id="somewhere">
var x = document.getElementById('somewhere');
x.onclick = highlightNavItem; // note: no parentheses
3 Executing event handlers directly
x[i].onkeyup = x[i].onchange = checkMaxLength;
x[i].onkeyup();
4 Anonymous functions
5 W3C and Microsoft models
相关文章推荐
- JavaScript基础知识学习笔记
- 学习javascript基础知识系列第二节 - this用法
- 黑马程序员-javascript基础知识学习笔记
- javascript学习总结(一):基础知识。
- javascript 基础知识学习1
- javascript基础知识大全 便于大家学习,也便于我自己查看
- 【学习】Javascript正则表达式——基础知识小结
- JavaScript 基础知识之对比记忆学习
- JavaScript学习总结(7)——JavaScript基础知识汇总
- 学习javascript基础知识系列第三节 - ()()用法
- javascript基础知识和Dom编程学习
- JavaScript与PHP基础知识对比学习
- JavaScript学习笔记(一)——JS基础知识介绍
- 栋栋晓10:Javascript学习总结:基础知识2(语句,函数,)
- JavaScript常用基础知识强化学习
- JavaScript学习总结(7)——JavaScript基础知识汇总
- JavaScript学习笔记(1)基础知识
- javascript学习第一章:基础知识的学习
- HTML5学习笔记 —— JavaScript基础知识
- 从面试题学习Javascript——基础知识