javascript--第二天

var thisDate = new Date();
document.writeln(thisDate.toString());用于显示当前的时间

if ((thisDate.getDate() >= 1 && thisDate.getDate() <=6) &&
(thisDate.getHours() >= 9 && thisDate.getHours()<= 15))
用这样的语句可以使网页在一定的时间里做出if语句里的动作

thisDate.getDay()得到当前是星期几.

var Surl = document.URL.split(“//“);表示用//分割
var part = Surl[1].split(“//“);表示用/分割.因为/“会变为转意字符.

function newDoc()
{
document.open();
document.write(“byebye”);
document.close();
}//这是在script中写的

New Document这在外面写
这是一种打开新页的方法

window.location = “http://www.yahoo.com/”;用这句就可以打开google网站了.
不过要注意加http://否则就会到硬盘的相对路径上.

var placeHold = window.open(“PageLoading.html”,”placeholder”,
“width = 200, height = 200”);//打开一个长宽为200的PageLoading.html
window.open(pageURL,name,parameters) 这是window.open()函数
在body中这样写即可把刚加载的页关闭.

  • 本文作者: 帐前卒
  • 本文链接: http://chillyc.info/2006/976748/
  • 版权声明: 本博客所有文章除特别声明外,只能复制超链接地址,且必须注明出处!