JavaScript brings a web page to life. When stuff is moving around or user interaction is available on a web page, then you will probably find JavaScript behind the scenes providing the code for this interactivity. In this activity, you will see how websites use JavaScript by disabling it. Then you will remix a project to see and update JavaScript code.
You can see how websites use JavaScript by disabling it. Go to a site that has some interactivity and disable JavaScript on your browser:
From Chrome, select Menu -> Settings -> Content Settings (under Privacy). Select “Do not allow any site to run JavaScript”.
In Firefox’s address bar, type about.config and press Enter. Click “I’ll be careful, I promise!” In the search bar, search for javascript.enabled. Double-click on that row to change the value to False.
From Safari, select Preferences -> Security. Uncheck “Enable JavaScript”.
What features that no longer work on this website when you disable JavaScript?
NOTE: Be sure to enable JavaScript again!
Remix the Magic 8 Ball project
Can you figure out how to update the predictions?
Can you figure out how to change the image that appears when you select Click me if you dare?
Remember that syntax errors are probably the most common errors you will get and sometimes the most frustrating to debug. If you get stuck, you can always remix the project from scratch again.
BitsBox - learn JavaScript while creating an “app”
CodeCombat - learn JavaScript while playing a game
Code Maven - JavaScript Tutorial by Crunchzilla