===== CS 328 - Week 14 Lecture 2 - 2024-04-24 ===== ===== TODAY WE WILL (AFTER CS Faculty Candidate Dr. Sreekanth Malladi's talk) ===== * OK, recording now... * announcements * "use strict"; * async and defer * JavaScript Array object * maybe a bit more about the JavaScript DOM (Document Object Model) * WILL be posting a link to a Google form to comment on Dr. Malladi's teaching talk ===== * should be working on Homework 11 * at-least-first-attempts due by 11:59 pm on FRIDAY, May 3 * should be reading/doing activities in zyBooks Chapter 6 - More PHP and Chapter 7 - JavaScript Fundamentals * deadline to complete these: 11:59 pm pm Friday, May 3 * keep an eye out for recordings as they are posted; * will post on Canvas regarding the status of Friday's labs...!!! ===== "use strict"; * since ECMAScript 5 * causes more-strict syntax checking * you can put this as the 1st thing in an external .js file * you can also put this as the first line of a function function my_strict() { "use strict"; ... } ==== async="async" and defer="defer" ==== * esp.for external JavaScripts, in the script element adding them to a document * if you add one of these to a script element, you are assuring the browser the script won't muck with the being-downloaded-HTML via the DOM before the page is loaded so the browser can safely keep parsing the HTML as it downloads the JavaScript * use async="async" if all scripts are independent of one another use defer="defer" if a script needs something from a previous script (reasonable compromise -- still parses HTML in parallel, but does have to wait until document has been loaded to execute the JavaScript...) ====== * note that document methods such as: getElementsByTagName getElementsByClassName ...return an array of the objects with the specified tag or class name so keep that in mind!