+ 1
Module 1 quiz: last q
To let the web page fully load in the browser window???,,????,, I didn't get ! what does this means?
4 Answers
+ 4
When the browser ( internet navigator ) get a web page to display, it has a lot things to do, in addition of the time of data transmission. So it start to interprete the content of web page as soon as it receive the first data ( few first lines of the html code ), and if there's javascript on top on document ( in <head> tag ), likely to be executed before all the content of the <body> tag exist ( was loaded ): if the javascript must access to certains elements not already loaded, you'll get a script error...
The solution is either to place the javascript after the element required by the script ( be sure it exist before executing script ), either to make the script waiting for the page loaded ( there's events you can handle for that ). When in the past it was recommanded to put maximum of scripts in the <head> tag, today the paradigme has changed and now it's recommanded to put scripts to bottom max of the page ( just before the </body> closing tag ) for optimizing the times of loading ( in the past, we don't have the data associated to css code to treat -- also, it's possible to insert css anywhere in the html like the js, but it's more friendly user experience if all style were defined at first displaying ).
0
ok
0
Fill in the blank to apply white text color to the paragraph.
p {
#FFF;}
- 4
.
("JS is cool!");