批改状态:合格
老师批语:自己扩展了一些内容,这很好!
弹框类的方法。前面省略window
alert(‘提示信息’)
confirm(“确认信息”)
prompt(“弹出输入框”)
open(“url地址”,“_black或_self”,“新窗口的大小”)
close() 关闭当前的网页
定时器,清除定时器
setTimeout(函数,时间) 只执行一次
setInterval(函数,时间) 无限执行
clearTimeout(定时器名称) 清除定时器
location.herf = ‘url地址’
hash 返回#号后面的字符串,不包含散列,则返回空字符串。
host 返回服务器名称和端口号
pathname 返回目录和文件名。 /project/test.html
search 返回?号后面的所有值。
port 返回URL中的指定的端口号,如URL中不包含端口号返回空字符串
portocol 返回页面使用的协议。 http:或https:
| 属性 | 描述 |
|---|---|
| availHeight | 返回显示屏幕的高度 (除 Windows 任务栏之外)。 |
| availWidth | 返回显示屏幕的宽度 (除 Windows 任务栏之外)。 |
| bufferDepth | 设置或返回调色板的比特深度。 |
| colorDepth | 返回目标设备或缓冲器上的调色板的比特深度。 |
| deviceXDPI | 返回显示屏幕的每英寸水平点数。 |
| deviceYDPI | 返回显示屏幕的每英寸垂直点数。 |
| fontSmoothingEnabled | 返回用户是否在显示控制面板中启用了字体平滑。 |
| height | 返回显示屏幕的高度。 |
| logicalXDPI | 返回显示屏幕每英寸的水平方向的常规点数。 |
| logicalYDPI | 返回显示屏幕每英寸的垂直方向的常规点数。 |
| pixelDepth | 返回显示屏幕的颜色分辨率(比特每像素)。 |
| updateInterval | 设置或返回屏幕的刷新率。 |
| width | 返回显示器屏幕的宽度。 |
。
| 方法 | 描述 |
|---|---|
| back() | 返回上一页。 |
| forward() | 返回下一页。 |
| go(“参数”) | -1表示上一页,1表示下一页。 |
<!DOCTYPE html>声明文档类型<html lang="zh-CN">用于声明代码编译语言<head>头部标签,用来定义文档的页眉<meta charset="utf-8">采用utf-8字符集<title></title>文档标题<meta name="keywords" content="">关键词,基本用不上了<meta name="description" content="">文档描述<meta name="renderer" content="webkit">优先以webkit内核渲染<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">针对IE8以下浏览器不识别情况,指定兼容模式<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">设置视图窗口<style>//内部层叠样式表</style></head><body></body><script>//js代码段</script></html>
document.getElementById();
document.getElementsByClassName();
document.getElementsByTagName();
document.querySeletor();
document.querySelectorAll();
| 选择器 | 权重 |
|---|---|
| id | 100 |
| 类 | 10 |
| 元素 | 1 |
| 继承 | 0.5 |
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号