lec-js-01
13th: Midterm 2 (JS)
15th: Withdraw Deadline
I'll be in B107, rarin' to help.
I'm fully aware it's a late Friday lab at the start of Reading Week.
I'll be around some of the time.
I'll update my calendar regularly.
Why aren't people getting help?
How's that working out?
Beats me.
If you show up and demo what you have - even if you're not checking every box - no penalty.
If you don't show up, the penalty is in effect.
The final marking scheme will remain in effect.
◉ How can we use JavaScript to deface a website?
◉ What will working on JS in Codespaces be like?
◉ How do I bring external JS into my pages?
◉ What's working with JS objects like?
◉ What's JSON and how do I work with it?
// change text with the textContent property
someElement.textContent = "We promise to be down at the most inconvenient time.";
// add an element to the page
let h1 = document.createElement('h1');
h1.textContent = "I AM THE NEW H1 IN TOWN";
temp.appendChild(h1);
// remove an element - buh bye
someElement.remove();
// change the style of a page element
someElement.style="background-color: #bada55;"
// remove attributes from an element
someElement.href = "";
// change behaviour on click
someElement.addEventListener("click", function() { alert("Wa ha ha! I'm in control now!"); })If you're not living in the dev tools over the next 7 weeks, you're doing something terribly wrong.
⚠️
01-js-in-our-codespace
Side Note:
We technically don't need Apache or PHP on our Codespace here - and leaving it off would speed things up. So why keep it?
02-external-js-no-modules
02-external-js-with-modules
I'm not throwing shade here: browser support for modules was sucky around the time the text was released!
03-sharing-with-modules
Here's a very nice blurb on those script tags.
Here's a very nice blurb on imports and exports.
Let's talk about objects, because they're more interesting...
...but you're still expected to know what the primitive types are! 😏
04-object-literals
05-object-constructor-functions
06-json-from-objects
07-objects-from-json