码迷,mamicode.com
首页 > 编程语言 > 详细

Javascript回顾

时间:2016-05-25 20:36:46      阅读:175      评论:0      收藏:0      [点我收藏+]

标签:

Javascript构成:基本知识(语法、概念)内置类、DOM、事件、面向对象。

基本知识:

  1. 语法规则:区分大小写;变量、函数、属性、函数的参数第一个字符必须是字母、下划线、或美元符号其他字符可以是字母、下划线、美元符号、数字;采用驼峰式写法
  2. 表达式与运算符(算术运算符+、—、*、/、%、++、——、+value变量取正、—value;赋值运算符=、+=、—=、*=、/=、%=、<<=、>>=、>>>=;关系运算符<、>、==、===、<=、>=、!=、!==;逻辑运算符&&与、||或、!非;位运算符&、|、~、^、<<、>>、>>>;其他[]、instanceof、typeof、new、void、delete、in)优先级
  3. 数组:var name=[value,value,……]
  4. 注释://,/***/
  5. 内部,匿名函数,
  6. 参数
  7. 变量:var name,不加var的变量为全局变量
  8. 数据类型:检测给定变量的类型typeof,字符串、布尔、数组、对象、Null、Undefined、Number:NaN、+Infinity、-Infinity,类型转换:隐式转换、显式转换(parseInt、parseFloat、),常量,转义字符
  9. 流程控制:if,do-while,while,for,for-in,label,break、continue,with,switch(){case:……default},变量=布尔值?值1:值2
  10. 函数

内置类:JavaScript 对象JS Array、

JS Boolean

Browser 对象

HTML DOM 对象

HTML 对象

Global,静态对象不需要创建实例,动态对象需要创建实例

DOM:Node对象类型(Document、Element、Attr、processingIntruction、Comment注释、Text、CDATASection、Entity)、属性(attributes、childNodes、firstChild、lastChild、nextSibling、nodeName、nodeType、parentNode、previousSibling)、方法(appendChild()、cloneNode()、hasChildNodes()、insertBefore()、removeChild()、replaceChild());获取节点(getElementById、getElementsByTagName、getElementsByName),生成节点(createElement、createAttribute、createTextNode、createComment),插入节点(insertDate、deleteDate);替换(replaceDate);对属性进行操作(createAttribute、setAttribute、getAttribute、removeAttribute)改变节点样式、属性、值

事件:事件句柄(onabortonbluronchangeonclickondblclickonerroronfocusonkeydownonkeypressonkeyuponloadonmousedownonunloadonsubmitonselectonresizeonresetonmouseuponmouseoveronmouseoutonmousemove、)鼠标 / 键盘属性(altKeybuttonclientXclientYctrlKeymetaKeyrelatedTargetscreenXscreenYshiftKey)IE 属性(cancelBubble、fromElement、keyCode、offsetX,offsetY、returnValue、srcElement、toElement、)Event属性(type、target、currentTarget、srcElement、eventPhase、timeStamp事件发生的时间、bubbles指明该事件是否起泡、cancelable是否可以用button一个数字、altKey、ctrlKey、clientX、clientY、screenX、)Event方法:screenY、initEvent()、preventDefault取消默认动作、stopPropagation终止事件传播、)

面向对象:继承

异常:try{}catch(){}

调试:错误(语法、运行时、逻辑);alert()write();writeln();Firebug

Javascript回顾

标签:

原文地址:http://www.cnblogs.com/searchreal/p/5518662.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!