Friday , 17 November 2017
Home / Tag Archives: all (page 4)

Tag Archives: all

Event Handlers – Advanced JavaScript Tutorial

Event Handlers

If you’ve seen my events tutorial in my JavaScript basics tutorial series, then you already know how to use events. There’s another way of using events with event handlers. Before we begin, let’s update the <body> tags in our document to this. [crayon-5a0f4d0937fce106185784/] We just have a simple button in our document with the ID btn. To add an event, …

Read More »

Data Attribute – Advanced JavaScript Tutorial

Data Attribute

HTML5 is fairly new and it’s slowly being adopted by all web browsers today. A special feature of HTML5 is the ability to define custom data attributes. A data attribute is your own attribute that can contain information about an element. Let’s update our document to this. [crayon-5a0f4d093937d818610205/] To create a data attribute, you simply create an attribute with the …

Read More »

Selectors API – Advanced JavaScript Tutorial

Selectors API

The selectors API is a simpler way to grab elements by using CSS queries. If you recall, you can change the styles of an element using CSS. Here’s an example of how you would do so. [crayon-5a0f4d0939863926349435/] To grab an element in general, you just type in the tag name. To grab an element with an ID, you type a …

Read More »

Navigator Object – Advanced JavaScript Tutorial

Navigator Object

The navigator object allows you to grab information about the browser and visitor’s computer. You can grab the browser name, plugins, OS, language, etc. Properties Clear your script and add this bit of code. [crayon-5a0f4d0939fea961117088/] The navigator object is pretty tricky. Even though the navigator object has been around since Netscape Navigator 2, the properties and methods are supported in …

Read More »

Location Object – Advanced JavaScript Tutorial

Location Object

The location object contains information about the current URL you’re visiting. It can give you helpful information such as the port number, whether or not the site is using SSL and even allows you to redirect the user. Properties Clear your script and add this bit of code. [crayon-5a0f4d093ac8d326659579/] There are a couple of properties of the location object, but …

Read More »

Timing Events – Advanced JavaScript Tutorial

Timing Events

There are 2 kinds of timing events. There’s one with timeouts and another with intervals. Timeouts execute once after a certain amount of time has passed by. Intervals execute repeatedly after a certain amount of time has passed by. Timeouts Clear your script and add this bit of code. [crayon-5a0f4d093b8a5724729353/] To create a timeout you use the setTimeout() method. This …

Read More »

Window Object – Advanced JavaScript Tutorial

Window Object

There’s one object to rule them all. That is the global object. Every variable, object and function is part of the global object. The global object can’t be accessed directly. However, most JavaScript host environments create an object that act as the global object. For browsers, this is known as the window object. Let’s take a look at how the …

Read More »

Closures – Advanced JavaScript Tutorial

Closures

Closures allow you to take your JavaScript skills to the next level. Closures are used in almost every JavaScript code you’ve ever seen. You’ve probably ended up using it without knowing it. So, what are closures? A closure is a function inside a function. So, what’s so special about this? Well, you can actually access the variables outside of the …

Read More »

Recursive Functions – Advanced JavaScript Tutorial

Recursive Functions

We’re going to stop talking about object oriented programming for now. Let’s focus on functions. There’s a thing called recursive functions. It’s just a function that calls on itself until a condition has been met. Almost like a loop. Setting Up The Script Clear your script and add this bit of code. [crayon-5a0f4d093d0e9169351221/] If you don’t know what factorials are, …

Read More »

Inheritance – Advanced JavaScript Tutorial

Inheritance

Another advantage to using prototypes is that you can have inheritance in your scripts. What is inheritance? Well, first let me show you and then I’ll explain. Clear your script and add this bit of code. [crayon-5a0f4d093d613099658021/] Alright, let’s break this done. We have 2 objects. One is BankAccount and the other is SavingsAccount. We add a method to the …

Read More »
ULTIMATE WORDPRESS DEVELOPMENT COURSE
Want to learn how to create your own custom WordPress plugins and themes? Check out my course!
Get 93% off my course. You'll also learn how to integrate WooCommerce and BuddyPress into your projects. This is a limited time offer
Yes, I would like to get 93% off your course!
No Thanks!
close-link