function scrollleft()
{
var tle=document.title;
var first=tle.charAt(0);
var last=tle.substring(1,tle.length);
//获取当前的titile文本
document.title=last+first;
}
//可以重复循环
setInterval("scrollleft()",500);
clearInterval(10000);
//只执行一次
setTimeout("scrollleft()",500);
clearTimeout(10000);
// <body onbeforeunload="window.event.returnValue='hello'"> 弹出对话框,是否关闭当前页面
//跳转到该页面
navigate(http://www.baidu.com);
//获取当前浏览器的地址,设置当前浏览器的地址
location.href=http://www.baidu.com;
//页面刷新
window.location.reload();
//判断是否按下某个键
if(window.event.altKey)
{
alert("alt");
}
else
{
alert("otherkey");
}
//禁止数据提交
onclick=alert("数据错误");window.event.returnValue=false;
//判断屏幕分辨率
if(screen.width<1024 || screen.height<768)
{
alert("分辨率太低,无法正常显示!");
}
//操作剪贴板
clipboardData.getData("Text");
clipboardData.setData("Text",val);
clipboardData.clearData("Text");
//前进后退
window.history.back();
window.history.forward();
window.history.go(-1);
window.history.go(1);
//用于嵌套javascript脚本,广告
document.write()