当前位置:网站首页>8、 BOM - chapter after class exercises and answers
8、 BOM - chapter after class exercises and answers
2022-06-11 21:28:00 【Xiong xiansen's Treasure】
Chapter 1 links : First time to know JavaScript - Chapter after class exercises and answers
Chapter II links :JavaScript Basics ( On ) - Chapter after class exercises and answers
Chapter 3 links :JavaScript Basics ( Next ) - Chapter after class exercises and answers
Chapter 4 links :JavaScript function - Chapter after class exercises and answers
Chapter 5 links :JavaScript object - Chapter after class exercises and answers
Chapter 6 links :DOM( On ) - Chapter after class exercises and answers
Chapter 7 links :DOM( Next ) - Chapter after class exercises and answers
notes : It is published by the people's post and Telecommunications Publishing House 《JavaScript+jQuery Interactive Web The front-end development 》 Books .
One 、 Completion
1、 stay BOM in , The parent of all objects is ______.
2、 The event triggered after all the contents in the page are loaded is ______.
3、history Object's ______ Property to get... In the history list URL Number .
4、 ______ Event is in DOM Triggered after the structure is loaded .
Two 、 Judgment questions
1、 Global variables can be accessed through window Object to access .( )
2、 modify location Object's href Property can be obtained or set URL.( )
3、 Use clearTimeout() and clearInterval() You can clear the timer .( )
4、 Use history Object's go() Method can realize page forward or backward .( )
3、 ... and 、 choice question
1、 In the following options , No window The properties of the object are ( ).
A. pageX B. location C. history D. navigator
2、 The following about BOM Description of the object , The wrong is ( ).
A. go(-1) And back() Both represent a step back from the history list
B. adopt confirm() Realized “ confirm ” Dialog box , single click “ confirm ” When to return to true
C. go(0) Refresh the current web page
D. None of the above options are correct
3、 The following description is wrong ( ).
A. onload and DOMContentLoaded All are page loading events , There is no difference between
B. DOMContentLoaded There is a browser compatibility problem
C. The variables defined in the global scope are window Object properties
D. window Object can be omitted when calling window
Four 、 Programming questions
Programming , Realize the effect of automatic movement of electronic clock , A button is provided to control whether the electronic clock stops moving .
Refer to the answer :
One 、 Completion
1、window
2、window.onload
3、length
4、document.DOMContentLoaded
Two 、 Judgment questions
1、 Yes 2、 Yes 3、 Yes 4、 Yes
3、 ... and 、 choice question
1、A 2、D 3、A
Four 、 Programming questions
Write functional code , The specific code is as follows :
<a id = "time"></a> <button onclick = "clearInterval(time1)"> stop it </button> <script type="text/javascript"> var time1 = window.setInterval('timeShow()', 1000); timeShow() function timeShow() { var today = new Date(); // Get system current time var intYears = today.getFullYear(); // Get year intMonths = today.getMonth() + 1; // Get the month +1 intDates = today.getDate(); // Get days intHours = today.getHours(); // Get hours intMinutes = today.getMinutes(); // Get minutes intSeconds = today.getSeconds(); // Get seconds intWeeks = today.getDay(); // Get week // Change the format to * year * month * Japan years = intYears + ' year '; // If the month is less than 10, Add... Before the month 0 intMonths < 10 ? months = '0' + intMonths + ' month ' : months = intMonths + ' month '; // If the day is less than 10, Add in front of the day 0 intDates < 10 ? dates = '0' + intDates + ' Japan ' : dates = intDates + ' Japan '; // Modify week format var week = [' Sunday ', ' Monday ', ' Tuesday ', ' Wednesday ', ' Thursday ', ' Friday ', ' Saturday '] weeks = week[intWeeks] + ' '; // Modify the hour format if (intHours == 0) { hours = '00:'; } else if (intHours < 10) { hours = '0' + intHours + ':'; } else { hours = intHours + ":"; } // Modify the minute format if (intMinutes == 0) { minutes = '00'; } else if (intMinutes < 10) { minutes = '0' + intMinutes; } else { minutes = intMinutes+ ":"; } // Modify the format of seconds if (intSeconds == 0) { seconds = '00'; } else if (intSeconds < 10) { seconds = '0' + intSeconds; } else { seconds = intSeconds; } var timeString = years + months + dates + weeks + hours + minutes+seconds document.getElementById('time').innerHTML = timeString; } </script>
边栏推荐
- Object creation process of JVM
- JVM之堆区
- LabVIEW controls Arduino to realize infrared ranging (advanced chapter-6)
- AC自动机
- Comprehensive RTL code design method and precautions
- 常用文件函数
- RANSAC提取圆柱(MATLAB内置函数)
- 俩月没发过博客了,发一篇证明自己的账号还活着
- [Part 14] source code analysis and application details of completionservice class [key]
- 如何利用RPA机器人开启货代行业数字化转型第一步?
猜你喜欢

Codeforces Round #744 (Div. 3) 解题报告

Syntax of SQL

UML系列文章(29)体系结构建模---模式和框架

Answer fans' questions | count the number and frequency of letters in the text
![[Part 15] use and basic principle of forkjoinpool [key]](/img/36/e21b16ec92d444149bc793f340f9f3.jpg)
[Part 15] use and basic principle of forkjoinpool [key]

LeetCode-110-平衡二叉树

LeetCode-129-求根节点到叶节点数字之和

JVM|运行时数据区;程序计数器(PC寄存器);

Leetcode-104- maximum depth of binary tree

领先企业推进智慧财务的同款效率工具,赶快了解一下?
随机推荐
AC自动机
JVM之堆区
AC automata
RPA丨首席财务官如何找到数字化转型“超级入口”?
Goto statement of go language
Expérience 10 génération de courbes bezier - amélioration expérimentale - génération de courbes B - spline par point de contrôle
Chain storage structure of linear table
2021-09-11 训练场补题
Comprehensive RTL code design method and precautions
Stream Chinese sorting
ASCII code comparison table
RANSAC提取圆柱(MATLAB内置函数)
LeetCode-104-二叉树的最大深度
Application business layer modification
[Part 14] source code analysis and application details of completionservice class [key]
Redis basic data type (hash)
Go language functions
JUnit tests multithreaded code, and the sub thread does not run
JVM|类加载器;双亲委派机制
应用业务层修改