【js】text

document.write(document.lastModified) 网页最后一次更新时间

//document.onmousedown = function(){ alert('document.onmousedown')};
//双击鼠标产生事件
document.ondblclick = function(){ alert('document.ondblclick')};
//单击鼠标产生事件

var a = Math.random() * 10;
//随机涵数,只能是0到1之间的数,如果要得到其它数,可以为*10,再取整
alert(a);
alert(Math.floor(a));
//将对象number转为整数,舍取所有小数

document.writeln("返回当前浏览器名称:" + navigator.appName);
document.writeln("返回当前浏览器版本号:" + navigator.appVersion);
document.writeln("返回当前浏览器代码名字:" + navigator.appCodeName);
document.writeln("返回当前浏览器用户代标志:" + navigator.userAgent);

var a = "hello world!";
alert(a.substring(6));

onLoad当网页打开,只能书写在body中

document.referrer 上一页的地址,本地路径无效

原文地址:https://www.cnblogs.com/jzm17173/p/2497474.html