1:javascript类型:
6种:undefined null number string boolean function
首字母大写才是类型: Undefined Number Object Function Null***
第7种 object
2:typeof运算符
alert(typeof a ) // undefined
if(typeof a =="undefined"){} //true
typeof返回的是字符串不是类型 ,一定要记住,所以上面的if语句中的引号是不能不写的的。
3:命名法: 应该使用 匈牙利命名法命名变量 驼峰命名法命名函数
4:javascript this指针 prototype使用
- $(function(){
- alert("aaaaaaaaaaa");
- function sayHi(){
- alert("hello");
- return this;
- }
- function sayHi2(){
- alert("hello2");
- return this;
- }
- function Person(){
- }
- Person.prototype.sayHello=sayHi;
- Person.prototype.sayHello2=sayHi2;
- var marry=new Person();
- marry.sayHello().sayHello2();
- });
5:javascript 编码 解码
这是javascript的函数.
encodeURI("url地址")//编码
decodeURI("url地址")//解码