您好,欢迎来到尚车旅游网。
搜索
您的当前位置:首页javascript温习的一些笔记基础常用知识小结_javascript技巧

javascript温习的一些笔记基础常用知识小结_javascript技巧

来源:尚车旅游网

以下是全部内容:

2010.11.29日
1.[window.]alert();
document.alinkColor
textString.anchor()
navigator.appCodeName
escape("Hi!") 返回ascii 码
eval("x+y") 对字符串求值 x=10,y=20;eval=30
formName.elementName.focus(); 设置元素成为焦点
history.forward() 前进浏览器
Date相关的函数
Date.getDate() 返回 1-31间的日期
Date.getDay() 返回星期几 周一到周六 0-6 间的数值
Date.getHours() 返回时 0-23
Date.getMinutes()
Date.getMonth()
Date.getSeconds()
Date.getTime() 得到时间截 从1970.1.1到现在的毫秒数
说明
{
}
Date.getTimezoneOffset() 得到客户机的时差 GMT
Date.getYear();
history.go();
document.linkName.hash 返回Url中#后面的字符串, 相同的用法有document.links[0].hash,document.location.hash
document.history 对象
document.history.forward();
document.history.back();
document.history.go(-1), -2
location.host,linkName.host, linkName.port 返回主机名和端口
location.hostname
location.href
formName.selectName.options[index].index 返回一个选择元素的下标
isNaN()检测是否为数字
stringName.italics() 设置为XIE 体格式
stringName.lastIndexOf(‘o'); 返回一个字符在字符串串尾开始数的索引下标
stringName.link();
事件
onChange=""
onClick=""
onFocus=""
onLoad=""
onMouseOver=""
onSelect=""
onSubmit=""
onUnload="" 退出文档的时候

document.open([MIMETYPE])
window.open("url","windows name"[,"windowFeatures"])

Date.parse("Jan 11,1996");
parseFloat(string)
parseInt(string[,radox]);

document.fromName.passwordName
location.pathname,link.pathname,links[index].pathname

windowName.prompt(message[inputDefault]);
protocal:
about,ftp,http,mailto,news,file,javascript

Math.random() 返回 0-1间的随机数
Math.round(argument)四舍五入
formName.resetButtonName

window.status
stringName.strike() 将字符转化成带删除线的字
stringNAme.sub() 将字符转化成下标文本格式
formName.submit() 执行与单击提交按钮相同的动作
stringName.substring(index1,index2) 取子串
stringName.sup() 转换成上标形式
target 规定一个窗口名的字符串 formName.target, forms[index].target,location.target,link.target,links[index].target

document.title 返回 标签中的中读值,没包含的话是空NULL <p>Date.toGMTString() 将一个日期转换在一个时间字符串 <p>stringName.toLowerCase(); <BR>stringName.toUppderCase() <p>window.top, window,top.frameName,window.top.frames[index]最高层的浏览器窗口 <p>navigator.userAgent 浏览器标识代理 <BR>documnet.vlinkColor 返回链接访问过的颜色值 <script type="text/javascript" src="https://jss.huatuo6.com/pc/wenzhang/detail_dy.js"></script> <script type="text/javascript" src="https://jss.sceh.cn/pc/wenzhang/detail_left.js"></script> </div> <div class="glfra_f"> </div> </div> <script type="text/javascript" src="https://jss.sceh.cn/pc/wenzhang/wenzhang/detail_foot.js"></script> <script type="text/javascript" src="https://jss.sceh.cn/pc/share_right_gg1.js"></script> <script type="text/javascript" src="https://jss.huatuo6.com/pc/share_right_xgzx.js"></script> <script type="text/javascript" src="https://jss.sceh.cn/pc/share_right_gg2.js"></script> <script type="text/javascript" src="https://jss.huatuo6.com/pc/share_right_rmyd.js"></script> </div> <div class="n_right"> <script type="text/javascript" src="https://jss.sceh.cn/pc/share_cebian_gg1.js"></script> <script type="text/javascript" src="https://jss.huatuo6.com/pc/share_cebian_rmht.js"></script> <script type="text/javascript" src="https://jss.sceh.cn/pc/share_cebian_gg2.js"></script> <script type="text/javascript" src="https://jss.huatuo6.com/pc/share_cebian_rmtw.js"></script> <script type="text/javascript" src="https://jss.sceh.cn/pc/share_cebian_gg3.js"></script> <script type="text/javascript" src="https://jss.huatuo6.com/pc/share_cebian_wntj.js"></script> </div> </div> <div class="foot"> <div class="smain"> <div class="foot_ano clearfix"> <!-- <div class="foot_logo"> <img src="images/logo_w.png" alt="AI游中国" /> </div> --> <div class="foot_mesg"> <p> Copyright © 2019-<span class="currentYear"></span> sceh.cn 版权所有 <a href="https://beian.miit.gov.cn/" target="_blank" style="color:#fff">湘ICP备2023017654号-4</a> </p> <p> 违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com </p> <p> 本站由北京市万商天勤律师事务所王兴未律师提供法律服务 </p> </div> </div> </div> </div> <script type="text/javascript"> const currentYear = new Date().getFullYear(); $('.currentYear').html(currentYear) </script>