首页 > 其他 > 详细

year:2017 month:7 day:19

时间:2017-07-19 21:30:30      阅读:254      评论:0      收藏:0      [点我收藏+]

2017-07-19

JavaScript

一:javascirpt的对象

1:数组对象

声明方式:(1)var arr=new Array();

     (2)var arr=new Array(12);

     (3)var arr[1,2,3,4]

2:字符串对象

一些有关的方法(1)indexof()获取字符下标

       (2)concat()要连接到字符串上的字符

       (3)split()通过输入的东西来分割字符串

       (4)substring()有两个参数,<包头不包尾>

3:Date对象

声明方式:var day=new Date();

一些有关的方法:(1)get year()+1990=get Fullyear()

        (2)get month()+1=真实的月份数

        (3)get day()=星期数

        (4)get date()=天数

        (5)to LocaleString()//获得当地时间

4:自定义对象

声明方式:(1)function person(有参){

       this.name=name;

       this.eat=function(){

       }     

      }

     (2)var person ={

      属性:值

      eat:function(){

       }

      }

     (3)var p=new person(){

      p.eat=function(){

       }

      }

二:BOM 

(1)Window

最常用的几种:Document.write,alert(),setInterval()

(2)screen

moveby 移动到指定位置
moveto 把窗口移动到固定位置
resizeto 增加或减小窗口
resizeby 将窗口调整成多大

(3)Location

(4)history

history.go(-1);//返回上一个链接
history.go(1);//返回下一个链接

history.forward();

history.back();

year:2017 month:7 day:19

原文:http://www.cnblogs.com/buyanyu/p/7207697.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!