码迷,mamicode.com
首页 > 其他好文 > 详细

151113

时间:2015-11-13 23:26:49      阅读:171      评论:0      收藏:0      [点我收藏+]

标签:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>

<script type="application/javascript">

var b=‘aadsfd‘.length;

alert("长度是"+b);

alert("查找到=" +"asfsfg".lastIndexOf(‘s‘));

alert("截取到=" +"asfsfg".substr(2,2));

alert("查找到=" +"asfsfg".substring(2,4));

alert("替换成=" +"asfsfg".replace(‘s‘,‘e‘));

var as="2015-12-12".split("-");

for(i =0;i< as.length;i++)
{
    alert("as="+as[i])
}

<!-- -->var dt = new Date(2016,12,22,12,12,12);
var dt = new Date();
alert(dt.getFullYear()+"-"+dt.getMonth()+"-"+dt.getDate()+" "+dt.getHours()+":"+dt.getMinutes()+":"+dt.getSeconds()+" "+dt.getDay());

</script>
</head>

<body>
<input type="button" value="打开"  onclick="window.open(‘http://www.baidu.com‘,‘百度‘,‘width=300,height=400,top=50,left=100,scrollbars=yes,resizable=yes,toolbar=yes,menubar=yes,location=yes‘);"/>

<input type="button" value="关闭" onclick="window.close();" />
</body>
</html>

 

151113

标签:

原文地址:http://www.cnblogs.com/zhuxiaolin/p/4963468.html

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