Posts Tagged javascript

Let’s Learn JavaScript • Lesson 6 • Statements and Comments

📅 August 18, 2017
The JavaScript interpreter executes lines of code one by one from top to bottom. A statement is a line of code that tells JavaScript what to do.

Statements contain keywords, which are words reserved by the JavaScript language for specific instructions. These keywords, combined with user data, form the statements that comprise a script.

Read the rest of this entry »

,

Leave a comment

Let’s Learn JavaScript • Lesson 5 • Object Primer

📅 July 31, 2017
“An object? What’s that?”

JavaScript uses object-oriented programming concepts (OOP) in order to make programming easier by mirroring real-world ideas.

While it is not necessary to use objects all of the time, it helps to understand what an object is because JavaScript views various parts of a web page and browser as objects.

Read the rest of this entry »

,

Leave a comment

Let’s Learn JavaScript • Lesson 4 • Planning a Script

📅 July 24, 2017
A script usually refers to a short program executed by an interpreter. Python, Perl, and JavaScript are examples of interpreted scripting languages. When we code client-side JavaScript, we write scripts that run in web browsers.

Scripts are intended to be lightweight and short in order to consume fewer system resources than full-fledged applications. This way, pages render faster in a web browser.

The purpose of using JavaScript in a web page is to make the page interactive either with the user directly or with a web server. Interactive pages are dynamic — page contents can change as the page is loaded or while the page is being viewed. JavaScript can access and modify page content and react to user input, such as button clicks or form entry. The result is a web page that feels more alive compared to static content that does not change.

No matter how simple or fancy a script might be, we need to plan before writing any code.

Read the rest of this entry »

,

Leave a comment

Let’s Learn JavaScript • Lesson 3 • Beginning JavaScript

📅 July 19, 2017
Continuing from the exciting Hello, Galaxy! HTML file we wrote in the previous lesson, let’s add some JavaScript to show a popup dialog and write text to the page.

 

Read the rest of this entry »

,

Leave a comment

Let’s Learn JavaScript • Lesson 2 • Basic HTML 5

📅 July 14, 2017
Client-side JavaScript requires a knowledge of HTML, so this lesson will focus on building a minimal HTML 5 file that we can use for writing JavaScript.

Read the rest of this entry »

,

Leave a comment

Let’s Learn JavaScript • Lesson 1 • Introduction

📅 July 13, 2017
Have you ever entered text in a search engine and noticed suggested results appear as you type? That’s JavaScript.

Have you scrolled through a web page of images and observed new images added to the page as you scroll towards the bottom of the page? That’s JavaScript.

 

Have you watched forms display a red border or error message as you finished entering a credit card number? That’s more JavaScript.

Have you ever thrown up your hands in anger as annoying popups littered your desktop with mind-jarring, blinking ads accompanied by new browser windows that expand to fullscreen in order to advertise an online survey? That, too, is JavaScript.

JavaScript is a programming language that produces dynamic web pages. If you have ever wanted to learn how to perform this mysterious magic in JavaScript, then here is the first lesson that introduces the background of this fun language.

Read the rest of this entry »

,

Leave a comment

JavaScript: Get a random number within a range

📅 April 26, 2017
The Math object in JavaScript provides the random() function that returns a floating point value from 0 to up to but not including 1.

What if we want to grab an integer, say, from 1 to 25 inclusive?

We can do this easily by modifying the random result to our liking.

Read the rest of this entry »

,

Leave a comment