1.Window objects:
It represents the browser window that opens
setInterval (): it has a return value, is supplied to the main clearInterval use.
setTimeout (): it has a return value, is supplied to the main clearTimeout use.
clearInterval (): This method can only be cleared by the timing of the operation setInterval set.
clearTimeout (): This method can only be cleared by the timing of the operation setting setTimeout.
Code:
< Script > // // confirmation pop-up box // Confirm The ( "OK to delete it?"); // // input box // prompt ( "Please enter the content:"); </ Script >
< Body > < A href = "02 - History Object .html" > Point me! </ A > </ body >
result:
2.History objects:
History object contains the URL the user visited (in the browser window)
History page: use location page (the href attribute value to the current history)
History page code:
<Input type = "button" value = "return to the previous page."
onclick="javascript:history.back()"/>
go parameters: a return -1 History page; -2 return to the previous page history; 1 enters the next context
History records page.
Click the button to make failure:
onclick=”javascript:volid(0)”
Code:
<script> function fanhui() { history.go(1);
// histroy.go(-1); // history.back(); } </script>
<body> <input type="button" value="返回上一页" onclick="fanhui()" /> <a href="03_location对象.html">下一页</a> </body>
3.Location 对象
Location 对象包含有关当前 URL 的信息。
href:该属性可以完成通过 JS 代码控制页面的跳转。
代码:
<body> <input type="button" value="跳转到history页面" onclick="javascript:location.href='02——history对象.html'"/> </body>
结果:
4.Navigator 对象
Navigator 对象包含有关浏览器的信息。(该对象开发中不怎么常用)
5.Screen 对象
Screen 对象包含有关客户端显示屏幕的信息。(该对象开发中不怎么常用)