Sorted by:  

How to Calibrate the Accelerometer for Your HTML5 Game

By default, the HTML5 game accelerometer assumes the neutral position of perfectly horizontal — that is, the device is lying flat on a table. However, these are mobile devices, and gamers will often want [more…]

How to Check Boundaries in Your HTML5 Game

Once sprites begin moving, there is always the possibility they'll leave the boundaries of the screen. Typically, HTML5 game developers respond in one of five ways: wrap, bounce, stop, die, or continue [more…]

How to Add Tilt Controls to Your HTML5 Game

Mobile devices have a very intriguing input mechanism that allows you to control objects in an HTML5 game by tilting. This works with a special on-board tool called the [more…]

How to Make Choices with if in Your HTML5 Game

Sometimes you'll need your HTML5 game code to make decisions or choices. For example, if somebody famous typed their name in your website, you might want to create a custom greeting for them. [more…]

How to Create Simple HTML5 Application Output with JavaScript

When writing applications in JavaScript, you must confront some issues before being really ready for them. It’s a chicken-or-egg scenario — which technique should you address first? That’s how it is with [more…]

How to Create JavaScript Statements for HTML Integration

To be able to integrate JavaScript with HTML, it’s essential for web developers to understand how JavaScript statements work. Here is some essential information to help you work with JavaScript statements [more…]

How to Write Comments in JavaScript for HTML Integration

Comments are an important part of your JavaScript application. While you may easily remember what an application does for a day or two after you write it, trying to figure out what complex applications [more…]

How to Alert Visitors That Your Site Requires JavaScript

Many users are wary of enabling JavaScript support for sites because they don’t want to download a virus or have other bad things happen to their systems. In addition, people have become less receptive [more…]

How to Integrate JavaScript and HTML with Boolean Variables

For web developers, Boolean variables have only two possible values: true or false. Computers need a way to determine whether something is true or false in order to make decisions. The decision-making [more…]

How to Use Text to Integrate JavaScript with HTML

As far as JavaScript is concerned, strings are just one of many data types web developers can use to integrate with HTML. The text or string data type is the presentation format that most humans think [more…]

How to Use Arrays to Integrate JavaScript with HTML

In JavaScript, arrays are a kind of collection. You can work with arrays to integrate JavaScript with HTML. Each array contains zero or more like items that you can manipulate as a group. [more…]

How to Use JavaScript Objects for HTML Integration

JavaScript comes with a host of built-in objects that help you perform general programming tasks. You can create a new variable of any type you want. JavaScript also supports a number of other built-in [more…]

How to Use JavaScript Object Literals for HTML Integration

In JavaScript, an object literal is a special kind of data collection. It contains named values that you use to make accessing a particular value easier. The idea is to create a package that you can send [more…]

How to Manipulate and Search JavaScript Strings to Program with HTML

In JavaScript, strings are what most humans equate to computer data because people see output onscreen as strings. Fortunately, JavaScript provides a wealth of ways in which to interact with strings. [more…]

How to Use the Date Object to Integrate JavaScript with HTML

Dates are used in all sorts of ways, but the most common techniques you must master in JavaScript applications are formatting and time span calculation. People want dates and times formatted in a way they [more…]

How to Use JavaScript’s Built-In Functions to Program with HTML

JavaScript gives you access a number of built-in functions, including the prompt() function, which lets you ask the user for written input. As with the [more…]

How to Use JavaScript’s Math Object to Program with HTML

The Math object is a special sort of object in JavaScript — you use it to access math-related functionality, rather than create new objects. As with any JavaScript object, you can create an instance of [more…]

How to Reduce Work with Custom Functions in JavaScript

Using custom functions helps reduce the work you must perform in JavaScript when creating an application and integrating with HTML. Functions help you reduce your workload in the following ways: [more…]

How to Create Custom Functions with a Return Value in JavaScript

Many of the built-in functions in JavaScript provide some sort of return value to program with HTML, and you can create functions that provide a return value, too. Use a return value when the function [more…]

How to Create Custom Functions with Optional and Required Arguments in JavaScript

All arguments for a JavaScript function are optional. In fact, the caller can send as many arguments as desired to program with HTML. Of course, if you’re expecting only one argument, then you’ll process [more…]

How to Work with JavaScript’s Private Properties and Methods to Program with HTML

Many web developers are under the impression that JavaScript doesn’t provide private properties or methods. This isn’t the case. It’s true that JavaScript does lack any specific keyword that designates [more…]

When to Use the if Statement to Program HTML with JavaScript

You really can’t escape using the if statement with JavaScript. The if statement is commonly used for testing whether something has happened or not, whether the data is in range or not, or whether the [more…]

When to Use the switch Statement to Program HTML with JavaScript

Although the if statement is commonly used for simple choices in JavaScript, the switch statement is used to handle a range of choices. A switch provides an elegant way to handle variable data. There are [more…]

What You Should Know About Loops to Program HTML with JavaScript

The term loop brings up visions of circles. In some respects, when you create a loop in your JavaScript application, the application goes in circles. It keeps going in circles until you tell it to stop [more…]

How to Make Your First JavaScript for Loop

A for loop is best used in situations where you know you want to perform a specific number of cycles in HTML programming. You don’t necessarily know the number of cycles when you create the application [more…]

Sign Up for RSS Feeds

Computers & Software