This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 标识符(Identifier) # | |
| 定义 | |
| Java对程序中的各个元素加以命名时使用的命 | |
| 名记号称为标识符(identifier)。 | |
| 类名、变量名、常量名、方法名、… | |
| 特点 | |
| Java语言中,标识符是以字母、下划线(_)、美 | |
| 元符($)开始的一个字符序列,后面可以跟字母、 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 计算机基础概论 # | |
| var str = "hello world "; | |
| (2)var str = new String() | |
| # 2.string对象的方法 # | |
| (1)charAr() :返回字符串某一个下标的字符。 | |
| (2)charCodeAt() :返回字符串指定的位置的字符的 Unicode 编码。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 跳转语句 # | |
| break:浏览器执行到break,直接跳出循环或判断语句,结束本语句 | |
| continue:语句的作用是忽略其后的语句并结束此轮循环和开始新的一轮循环Continue与break语句非常类似,但他不是退出循环,而是转而执行下一次循环。return:语句结束函数执行,返回调用函数,而且把表达式的值作为函数的结果 | |
| # 函数的声明方法 # | |
| (1):使用function关键字 | |
| function a(){ | |
| } | |
| (2):使用变量和匿名函数 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 关于正则表达式 # | |
| 处理字符串时,有很多较为复杂的字符串用普通的字符串处理函数无法干净的完成。比如说,可能需要验证一个Email地址是否合法,为此需要查看许多不容易检查的规则。这正是正则表达式的用武之地。正则表达式是功能强大而简明的字符组,其中可以包含大量的逻辑,特别值得一提的是正则表达式相当简短。 | |
| # 正则表达式的用处 # | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 获取DOM节点的方法 | |
| 1.获取父节点 parentNode | |
| 2.获取该节点的子节点数组 childNodes | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # DOM 增删 # | |
| 1createElement():创建元素节点 | |
| 将需要创建的标签名,放到小括号中。加括号(加引号的是直接找到,不加是间接) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # BOM 方法 # | |
| 浏览器对象模型(Browser Object Model) | |
| BOM提供了独立于内容而与浏览器窗口进行交互的对象。 | |
| 由于BOM主要用于管理窗口与窗口之间的通讯,因此其核心对象是window. | |
| BOM由一系列相关的对象构成,并且每个对象都提供了很多方法与属性。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 什么是javaScript事件? # | |
| 事件(Event)是JavaScript应用跳动的心脏,也是把所有东西粘在一起的胶水,当我们与浏览器中Web页面进行某些类型的交互时,事件就发生了。 | |
| 事件是文档或浏览器中发生的特定交互瞬间! | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //获取一下浏览器的信息 | |
| var ff = navigator.userAgent.indexOf("Firefox"); | |
| //第一步:不同的事件添加方式 | |
| if(ff != -1){ //判断是否为火狐浏览器 |