JS演示效果

这个文件我自己写的JS演示效果,提供给初学者下载研究! :D
[code]<script>
document.writeln("appCodeName:"+navigator.appCodeName+"<br/>");
document.writeln("appName :"+navigator.appName+"<br/>");
document.writeln("appVersion:"+navigator.appVersion+"<br/>");
document.write("paltform:"+navigator.platform+"<br/>");
document.write("userAgent:"+navigator.userAgent+"<br>");
document.write("javaEnabled:"+navigator.javaEnabled()+"<br><br>");

document.write("screen width:"+screen.width+"<br>");
document.writeln("screen height:"+screen.height+"<br>");
document.write("screen availWidth:"+screen.availWidth+"<br>");
document.writeln("screen availHeight:"+screen.availHeight+"<br>");
document.write("screen colorDepth:"+screen.colorDepth+"<br><br>");

document.write("window name:"+window.name+"<br>");
//document.write("window status:"+window.status+"<br>");
status="say hello";
document.write("window opener:"+window.opener+"<br>");
document.write("self test:<a href=\"javascript:window.self.close();\">close self</a><br>");
document.write("window top:"+window.top+"<br>");
document.write("window location:"+window.location+"<br>");
document.write("window history:"+window.history+"<br>");
document.write("open() test:<a href=\"javascript:var myWin=window.open(\'1.htm\',\'_blank\',\'width=400,height=100,menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes\');\">open me to create myWin,please secondly view this page!</a><br>");
document.write("myWin close:<a href=\"javascript:myWin.close();\">close myWin</a><br>");
document.write("open() test with status:<a href=\"javascript:var myWin2=window.open(\'1.htm\',\'_blank\',\'width=400,height=100,menubar=no,toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,resizable=yes\');\">open me to create myWin2,please secondly view this page!</a><br>");
document.write("myWin2 close:<a href=\"javascript:myWin2.close();\">close myWin</a><br>");
document.write("window bulr:<a href=\"javascript:window.blur();\">blur this window</a><br>");
document.write("window focus:<a href=\"javascript:window.focus();\">focus this window</a><br>");
document.write("window scrollTo:<a href=\"javascript:self.scrollTo(100,100);\">scrollTo this window</a><br>");
document.write("window scrollBy:<a href=\"javascript:self.scrollBy(100,100);\">scrollBy this window</a><br>");
document.write("window resizeTo:<a href=\"javascript:self.resizeTo(100,100);\">resizeTo this window</a><br>");
document.write("window resizeBy:<a href=\"javascript:self.resizeBy(100,100);\">resizeBy this window</a><br><br>");
// alert("hello");
// confirm("say hello");
//prompt("请输入您的文本","say hello");
document.write("history length:"+history.length+"<br>");
document.write("history back:<a href=\"javascript:history.back();\">返回</a>");
document.write("history forward:<a href=\"javascript:history.forward();\">前进</a><br>");
document.write("history go(0) as location.reload()<a href=\"javascript:history.go(0);\">刷新本页</a><br><br>");

document.write("location protocol:"+location.protocol+"<br>");
document.write("location hostname:"+location.hostName+"<br>");
document.write("location port:"+location.port+"<br>");
document.write("location pathname:"+location.pathname+"<br>");
document.write("location host:"+location.host+"<br>");
document.write("location hash:"+location.hash+"<br>");
document.write("location search:"+location.search+"<br>");
document.write("location href:"+location.href+"<br>");
document.write("location href 2: <a href=\"javascript:location.href='2.htm';\">test location href</a><br>");
// document.write("location href 2: <a href=\"javascript:location='2.htm';\">test location href</a>");
document.write("location replace:<a href=\"javascript:location.replace('3.htm');\">test location replace</a><br><br>");

//document.write("document referrer:"+document.referrer+"<br>");
//document.write(document.cookie);
var expires = new Date();
expires.setTime(expires.getTime() + 3 * 30 * 24 * 60 * 60 * 1000);
/* 三个月 x 一个月当作 30 天 x 一天 24 小时
x 一小时 60 分 x 一分 60 秒 x 一秒 1000 毫秒 */
document.cookie = 'name=rose;expires=' + expires.toGMTString();
document.write(document.cookie);
</script>[/code]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值