js document用法
来源:互联网 发布:数据库建模关系 编辑:程序博客网 时间:2024/05/01 18:58
location-位置子对象
document.location.hash // #号后的部分
document.location.host // 域名+端口号//好像返回的是主机名localhost,没有返回端口号
document.location.hostname // 域名
document.location.href // 完整URL
document.location.pathname // 目录部分
document.location.port // 端口号
document.location.protocol // 网络协议(http:)
document.location.search // ?号后的部分
documeny.location.reload() //刷新网页
document.location.reload(URL) //打开新的网页
document.location.assign(URL) //打开新的网页
document.location.replace(URL) //打开新的网页
images集合(页面中的图象)
a)通过集合引用
document.images //对应页面上的img标签
document.images.length //对应页面上img标签的个数
document.images[0] //第1个img标签
document.images[i] //第i-1个img标签
b)通过name属性直接引用
img name=”oImage”
document.images.oImage //document.images.name属性
c)引用图片的src属性
document.images.oImage.src //document.images.name属性.src
d)创建一个图象
var oImage
oImage = new Image()
document.images.oImage.src=”1.jpg”
同时在页面上建立一个img /标签与之对应就可以显示
document.all.oDiv.style.display=”" //图层设置为可视
document.all.oDiv.style.display=”none” //图层设置为隐藏
图层对象的4个属性
document.getElementById(”ID”).innerText //动态输出文本
document.getElementById(”ID”).innerHTML //动态输出HTML
document.getElementById(”ID”).outerText //同innerText
document.getElementById(”ID”).outerHTML //同innerHTML
- js document用法
- js document.all用法
- JS document 用法
- js document.createElement()的用法
- js document.all的用法
- js、document.createElement()的用法
- js document.all的用法 .
- js中document.getElementById()用法
- js document.all的用法
- js document.all的用法
- js中document.write用法
- js document.all的用法
- JS中document.createElement()的用法
- js document.getElementById的用法详解
- js document.createElement()的用法 (转)
- JS中document.createElement()用法及注意事项
- js 中 document.createEvent的用法-转载
- js document.createElement()的用法 (转)
- 中文乱码
- AJAx 常见概念小结
- win7下关闭 最大化最小化时候的动画
- Android四大应用构件之Service解析
- POJ-2531 Network Saboteur 解题报告
- js document用法
- quart Spring 配置
- 数据库导入导出的问题
- 符合web标准的媒体播放器代码
- mysql中下划线是特殊的,like的时候必须转义
- Android学习笔记 - 调试篇
- Dynamics CRM 2011 编程系列(10):JS编程之构造OData查询字符串
- 百度收录的五个关键核心
- gSoap使用实例【转】