JavaScript Introduction
Overview
JavaScript is a popular, well-supported programming language that is used to create interactive and dynamic web pages and applications as well as mobile, and desktop applications. It is a high-level, interpreted language that is designed to run in web browsers. JavaScript can also be used on the server-side with the help of technologies like Node.js.
In this class you will learn how to apply your prerequisite, programming knowledge to the web using JavaScript. JavaScript uses the same concepts and common control structures as any other programming language.
JavaScript is one of the three, core technologies of web frontend development.The other two are HyperText Markup Language (HTML) and Cascading Styles Sheets (CSS).
- HTML defines the structure and meaning of a page.
- CSS defines the style or presentation of a page.
- JavaScript handles the behavior based upon user interaction and other events.
Associated Course Learning Outcomes
- Demonstrate proficiency with JavaScript language syntax.
- Use JavaScript to respond to events and dynamically modify HTML.
Activity Instructions
Answer the following questions using this resource What is JavaScript? - MDN Web Docs or use your own research.
You are encouraged to responsibly use contemporary language model and generative AI tools like ChaGPT, Bard, Bing Chat, or Meta AI. Learn to use these tools as an instant tutor to help define concepts, clarify questions, and to provide guidance.
- What is the file extension used for JavaScript files?
Check Your Understanding
.js
- How is JavaScript included on web pages?
Check Your Understanding
A
<script>
HTML tag is used to include JavaScript code in an HTML like this:
The<script></script>
script
tag can be used anywhere on the page.
This course uses external script files and places the source reference in thehead
of the HTML document. - What standard way does this course reference JavaScript?
- Use external JavaScript files.
- Place the JavaScript files in the
scripts
subfolder of the site. - Reference the script in the
head
of the HTML document. - The
defer
attribute will be used to ensure the HTML loads first.
Check Your Understanding
<script src="scripts/myscripts.js" defer></script>
Common Misconceptions and Language Issues
- JavaScript is not the same programming language as the Java programming language. They are two different languages with different syntax and purposes.
-
The plural form of "code" in programming is just "code", not "codes".
Example: "Please review my code." or "Please review my program". Not "Please review my codes." - JavaScript is not just for the browser and client-side scripting. With the introduction of server-side frameworks like Node.js, JavaScript can now be used for server-side development as well. JavaScript is a mature language and has become more powerful and versatile over time.
Optional Resources
- What is JavaScript? - codecademy ~10:00 minutes
- W3Schools
- JavaScript Hero