Archive for the ‘Raw Javascript’ Category

JavaScript Functions That Define and Rewrite Themselves

Posted on: No Comments
The following is a short extract from our new book, JavaScript: Novice to Ninja, 2nd Edition, written by Darren Jones. It's the ultimate beginner's guide to JavaScript. SitePoint Premium members get access with their membership, or you can buy a copy ...

Hello, World! Your First JavaScript Programs

Posted on: No Comments
The following is a short extract from our new book, JavaScript: Novice to Ninja, 2nd Edition, written by Darren Jones. It's the ultimate beginner's guide to JavaScript. SitePoint Premium members get access with their membership, or you can buy a copy ...

Learning JavaScript: 9 Common Mistakes That Are Holding You Back

Posted on: No Comments
A lot of people try to learn JavaScript and then give up. Then they tell themselves things like, "JavaScript is too confusing," or worse, "Maybe I'm not cut out for web development." The sad part? There was no need to give up. All that was needed was a...

10 Languages That Compile to JavaScript

Posted on: No Comments
Modern applications have different requirements than simple websites. But the browser is a platform with a (mostly) fixed set of technologies available, and JavaScript remains as the core language for web applications; any application that needs to run...

JavaScript Design Patterns: The Observer Pattern

Posted on: No Comments
In JavaScript, there is a problem that comes up often. You need a way to update parts of a page in response to certain events, with the data these provide. Say, for example, user input that you then project into one or many components. This leads into ...

Instant Form Validation Using JavaScript

Posted on: No Comments
HTML5 introduces a couple of new attributes for implementing browser-based form validation. The pattern attribute is a regular-expression that defines the range of valid inputs for textarea elements and most types of input. The required attribute speci...

6 jQuery-inspired Native DOM Manipulation Methods You Should Know

Posted on: No Comments
When jQuery was released, one of the main reasons behind its meteoric rise to popularity was the ease with which it could select DOM elements, traverse them and modify their content. But that was way back in 2006. In those days we were stuck with Inter...

The MVC Design Pattern in Vanilla JavaScript

Posted on: No Comments
Design patterns often get incorporated into popular frameworks. The Model-View-Controller (MVC) design pattern, for example, is one that is ubiquitous. In JavaScript, it is hard to decouple the framework from the design pattern. Oftentimes, a particula...

Back to Basics: What are Callbacks in JavaScript?

Posted on: No Comments
When learning JavaScript, it doesn't take long until you encounter callbacks. These might seem strange and mysterious to beginners, yet it is very important to understand how they work in order to harness the power of the language. In this article I wi...

What Is Event Bubbling in JavaScript? Event Propagation Explained

Posted on: No Comments
Event bubbling is a term you might have come across on your JavaScript travels. It relates to the order in which event handlers are called when one element is nested inside a second element, and both elements have registered a listener for the same eve...