
Master JavaScript basics to create interactive web pages, manipulating the HTML DOM with numbers, variables, strings, booleans, arrays, objects, and functions, plus control flow and error handling.
Learn how JavaScript runs in the browser to create interactive web pages with HTML and user events. Explore numbers, strings, booleans, variables, arrays, functions, objects, and the DOM.
Learn to set up a basic JavaScript environment, test code in a browser, and add JavaScript via inline button code, a script tag, or a separate file.
Explore how JavaScript handles numbers via the console for calculations, covering arithmetic, modulo, order of operations, scientific notation, and math objects with pi and e, including absolute value and exponentiation.
Learn how to declare strings with single or double quotes, use escape sequences, measure length, concatenate, and handle multi-line strings in JavaScript.
Explore basic string manipulation in JavaScript by using charAt and indexing from zero, slice and substring, and methods like indexOf, lastIndexOf, replace, split, and case conversions.
Learn to create and manipulate arrays in JavaScript, including initialization, zero-based indexing, length, and methods like push, splice, pop, and sort.
Explore how functions in JavaScript create reusable code units, covering naming, parameters, returns, anonymous and assigned functions, and how to call them from pages and the console, plus scope rules.
Explore conditionals in JavaScript: if, else, and else if with boolean tests controlling code flow. Also cover switch statements, fall-through, default cases, and the ternary operator for inline decisions.
Explore looping in JavaScript by examining while, do-while, and for loops, including syntax, array iteration, and practical uses such as repeating actions and retrying input.
Learn how to handle errors in JavaScript by validating input with Number(), throwing errors for non numeric and negative values, and using try, catch, and finally blocks.
Navigate the DOM to locate elements by id, class, name, or tag name, read and set text or input values, and add or remove elements.
Learn how to handle events in JavaScript by counting clicks on a title, updating its text, and attaching listeners for click, hover, and page load.
Learn to build a javascript function calculator that computes multiple functions of x, validates input with clear errors, and enables adding new functions via a simple map.
Learn how jQuery simplifies web development by selecting DOM elements with selectors, handling events, adding effects, and dynamically updating content with Ajax, plus setup via script tags or CDNs.
Explore jQuery selectors in practice, using the $ function to select by tag, id, class, and attributes; experiment with first, first-child, even/odd, and universal selectors to manipulate elements.
Learn to handle jQuery events, including document ready, click, dblclick, hover, mouse enter/leave, and keyboard events like key press and key up, with practical examples.
Explore how to use jQuery effects to manipulate page elements with hide, show, toggle, fade, and slide animations, including duration and callback options.
Explore jQuery animations by using the animate method to create custom effects beyond prepackaged sliding and fading, adjusting font size, margins, opacity, and top-left positioning with camelCase CSS properties.
Learn to manipulate the document object model using jQuery basics, including selecting elements by id, reading and writing text, attributes, and input values to update page content.
Learn to modify the DOM with jQuery by adding and removing list items in a ul using add and remove buttons, counting children, and appending elements.
Explore DOM traversal with jQuery through practical experiments. Learn to filter and navigate elements using children, siblings, next, prev, and the concepts of first, last, eq, and filter.
Explore ajax requests to fetch airport data from a web service, parse json, and display name, city, weather, and temperature on a page using jquery.
Learn to replace get with the ajax function to fetch data, set headers, handle success and error responses, and implement timeouts for robust ajax requests.
Overview
JavaScript is a programming language that can be run by all modern web browsers. It is downloaded alongside the HTML code of a webpage. Unlike HTML, which can only be used to display content, JavaScript allows web designers to add functionality and interactivity to their websites.
JQuery is a popular JavaScript library that is used extensively in modern websites. This library facilitates common JavaScript tasks such as animations, event handling, manipulating HTML content, and communication with external servers. In addition to its easy-to-use features, JQuery also takes care of many cross-browser compatibility issues automatically.
What you will learn
Javascrtipt Modules...
We will begin the course by learning where to write JavaScript. We will look at writing JavaScript directly inside an HTML tag, then inside of a <script> tag, and then finally in a file separate from the HTML document. We will discuss some of the reasons for using each method.
After that, we will learn about how to manipulate some basic data types. We will learn about how to do simple arithmetic, and also look at some of JavaScript's built-in mathematical capabilities. Then, we will learn about working with words and characters, using a data type known as the "string". We will also cover the Boolean type, which is a representation of True and False inside of a programming language.
Then we will move on to more complex types. We will learn about the array, which is essentially a list. We will look at how to create arrays, how to access elements inside them, and how to modify the contents of an array. Functions will also be covered, which will allow us to organize code into simple, reusable pieces. We will also learn about objects, which are a way of grouping together data and behaviors.
We will then move on to control flow. We will look at the "if" statement, which allows the script to decide whether or not to execute a block of code based on some condition. We will also look at looping. Looping refers to repeatedly executing a block of code until some condition is met. Then, we will learn about errors, and how to handle them properly so that they do not halt execution of the script.
Next, we will look at the Document Object Model ( DOM ). This is what allows JavaScript to interact with the HTML code of a webpage. We will look at several ways of finding any particular HTML element on the page. Then we will see what information we can extract from that element (tag name, attributes,etc.). We will learn about adding and removing elements from a page. Finally, we will learn about events, which allows JavaScript to react to things like mouse clicks, mouse movement, key presses, and many others.
We will end the course with a practical exercise, in which we will build a simple JavaScript-based webpage. We will put to use most of the concepts covered in the course. We will look at how to validate user input, how to display results, and how to display meaningful error message to the user.
jQuery Modules...
We will begin the course by learning about selectors. Selectors are strings that are used to target specific HTML elements on the page. The selector syntax is highly intuitive and easy to read and understand.
We will then move on to events. The student will learn how to write code that reacts to things like mouse clicks, key presses, when the page is done loading, and a few others. These events allow programmers to create interactive user interfaces.
After that, we will move on to effects and animations. Effects are used to hide and show elements. An example would be a menu that slides open when the mouse hovers over it. JQuery has a few built-in effects that can be implemented with minimal coding. For further customization, we will look at animations, which allow programmers to animate most of the visual properties of HTML elements.
Then we will learn about changing the HTML content of a webpage. This includes adding and removing entire HTML elements, as well as modifying text and other HTML attributes programmatically. We will also learn about how to navigate the tree-like structure of an HTML document using the concept of parent-, sibling-, and child-elements.
Finally, we will end the course by looking at AJAX, which stands for Asynchronous JavaScript and XML. AJAX allows programmers to interact with external servers. To serve as our example, we will read airport data from a public web service. We will learn how to request data, how to handle the response, and how to handle errors.
Prerequisites
HTML: The student must know how to use HTML tags and attributes. Only a very basic understanding of HTML is assumed.
Google Chrome (Recommended): Google Chrome is a free web browser and it will be
used to execute all the examples in this course. Although all browsers can run JavaScript, Chrome has extensive built-in developer tools. In the course, we will be using Chrome's JavaScript console, which will allow us to run quick little examples without the need to create and edit files.
Notepad++ (Recommended): Notepad++ is a free, open-source text editor. Although JavaScript and HTML can be written using any text editor, Notepad++ is highly recommended because of features such as syntax highlighting and auto-complete.