onbeforeunload只在IE下起作用…郁闷
02月 8, 2008
window.onbeforeunload = function ()
{
// . . .
event.returnValue = “You will lose any unsaved content”;
// . . .
}
window.onbeforeunload = function ()
{
// . . .
event.returnValue = “You will lose any unsaved content”;
// . . .
}
todayDate = new Date();
date = todayDate.getDate();
month = todayDate.getMonth() + 1;
year = todayDate.getYear();
document.write("今天是" + year + "年" + month +"月" + date + "日");//上面是我写的,下面是抄的
var urodz= new Date("August 8,2008");
var s = "2008北京奥运会";
var now = new Date();
var ile = urodz.getTime() - now.getTime();
var dni = Math.floor(ile / (1000 * 60 * 60 * 24)+1);//对比AW的flash倒计时发现少一天就+1
if (dni > 1)
document.write("
"+"离"+s+"还有"+dni +"天")
else if (dni == 1)
document.write("只有2天啦!")
else if (dni == 0)
document.write("只有1天啦!")
else
document.write("好象已经过了哦!");
网上一堆书签代码都是采用javascript winopen然后一大堆尾随其后,额。看了都晕,还找了一个是给Z-BLOG写的纯链接形式的。。不适用我的网店。链接的rel=noindex 不让GOOGLE跟踪。
采用JS写的write方法写的。图片直接显示,这样就只是客户端表现了,网页本身代码只加了图片而已, 代码比较少。我从别的网站找来的,想不要文字 直接改成图片链接,结果失败了,唉““先给自己的网店装上再说 况且用JS写的 以后改也方便。
网摘插件效果图:
点此查看
<
document.write(”Del.icio.us ”)
document.write(”Digg ”)
document.write(”Furl ”)
document.write(”Newsvine ”)
document.write(”Netscape ”)
document.write(”Reddit ”)
document.write(”StumbleUpon ”)
document.write(”Technorati ”)
document.write(”Squidoo ”)
document.write(”Windows Live ”)
document.write(”Yahoo MyWeb ”)
document.write(”Ask ”)
document.write(”Google ”)
Javascript: 轻量型、解释型 面向对象。
JavaScript核心:
第二章 词法结构
2.1.字符集
Unicode字符集(16 位)编写。
2.2.大小写敏感
在输入语言的关键字、变量、函数名以及所有的标识符时,都必须采用一致的字符大小写形式。
2.3.空白符和换行符
忽略程序中记号(token)之间的空格、制表符和换行符,除非他们是字符串或正则表达式直接量的一部分。
2.4.分号(;)
2.5.注释
//单行注释
/*
*多行注释
*多行注释
*/
2.6.直接量(literal)
数字、文本字符串、布尔值、null(空)、数组、对象
2.7.标识符
第一个字符必须为字母、下划线或美元符号。
疑问:直接量是什么概念还没搞清楚….