JavaScript

View:  
Sorted by:  

How to Use JavaScript to Make Decisions with Switch for HTML5 and CSS3 Programming

JavaScript, like a number of languages, supports another decision-making structure called switch. This is a useful alternative in HTML5 and CSS3 programming when you have a number of discrete values you [more…]

How to Use JavaScript to Create a For Loop for HTML5 and CSS3 Programming

The standard for loop in JavaScript counts the values between 1 and 10. The “count to ten” button triggers the count()function for your HTML5 and CSS3 programming. Here's the code for [more…]

How to Use JavaScript to Make a While Loop for HTML5 and CSS3 Programming

Here, you can see a dialog box asking for a password. When programming your HTML5 web page, you can use JavaScript to achieve this same box with a while [more…]

How to Manage Complex Loops in JavaScript for HTML5 and CSS3 Programming

It won't take long before you find situations where JavaScript’s standard for or while loops do not seem adequate for HTML5 programming. Consider a password box. You want to ask for a password until the [more…]

How to Manage JavaScript Errors with the Chrome Debugger for HTML5 and CSS3 Programming

By the time you're writing loops and conditions in JavaScript, things can go pretty badly in your HTML5 code. Sometimes it's very hard to tell what exactly is going on. Fortunately, modern browsers have [more…]

How to Debug JavaScript Errors with the Interactive Console for HTML5 and CSS3 Programming

The Developer Tools window in JavaScript has another really wonderful tool called the console. There's so much you can do for your HTML5 pages with this wonderful tool. Try this exercise to see some of [more…]

How to Resolve JavaScript Syntax Errors for HTML5 and CSS3 Programming

The most common type of JavaScript error in HTML5 is a crash or syntax error, usually meaning you misspelled a command or used a function incorrectly. From the user's point of view, browsers don't usually [more…]

How to Resolve JavaScript Logic Errors for HTML5 and CSS3 Programming

Logic errors in JavaScript are troublesome. In fact, they're nearly impossible to resolve on your HTML5 page without some sort of debugging tool. However, like a syntax error, when you can find a logic [more…]

How to Build a Basic Array in JavaScript for HTML5 and CSS3 Programming

Arrays are groups of variables in JavaScript with a name. Arrays are similar to functions because they're used to manage complexity for HTML5 and CSS3 programming. An array is a special kind of variable [more…]

How to Create a Basic Object in JavaScript for HTML5 and CSS3 Programming

JavaScript makes it trivially easy to build an object for HTML5 and CSS3 programming. Because a variable can contain any value, you can simply start treating a variable like an object and it becomes one [more…]

How to Add Methods to an Object in JavaScript for HTML5 and CSS3 Programming

Objects in JavaScript have other characteristics besides properties. They can also have methods. A method is simply a function attached to an object. To see what this means, take a look at this example [more…]

How to Build a Reusable Object in Javascript for HTML5 and CSS3 Programming

What if you want to build several objects in Javascript with the same definition? JavaScript supports an idea called a constructor, which allows you to define an object pattern and reuse it. [more…]

How to Use JavaScript Object Notation (JSON) for HTML5 and CSS3 Programming

JavaScript objects and arrays are incredibly flexible for HTM5 and CSS3 programming. In fact, they are so well known for their power and ease of use that a special data format called JavaScript Object [more…]

How to Create Drop-Down Lists in JavaScript for HTML5 and CSS3 Programming

The most obvious way to use JavaScript to ensure that the user enters something valid on your HTML5 page is to supply him with valid choices. The drop-down list is an obvious and easy way to do this. [more…]

How to Create a Multiple Selection List Box in JavaScript for HTML5 and CSS3 Programming

You can use the JavaScript selectobject in a powerful way for your HTML5 and CSS3 programming needs. To make multiple selection work, you have to make a few changes to both the HTML and the JavaScript [more…]

How to Create Check Boxes in JavaScript for HTML5 and CSS3 Programming

Check boxes fulfill another useful data input function in JavaScript for HTML5 and CSS3 programming. They're useful any time you have Boolean data. If some value can be true or false, a check box is a [more…]

How to Interpret Radio Buttons in JavaScript for HTML5 and CSS3 Programming

Getting information from a group of radio buttons in JavaScript requires a slightly different technique for your HTML5 page than most of the form elements. Unlike the [more…]

New HTML5/CSS3 Tricks for Validation

HTML5 and CSS3 add a few more tricks to simplify validation, and they are absolutely wonderful. While you can always use JavaScript and regular expressions to validate your pages, HTML5 promises a much [more…]

How to Set Up the JavaScript Canvas for HTML5 and CSS3 Programming

To use the <canvas> tag in JavaScript, build an HTML5 and CSS3 web page with a <canvas> element in it to begin. Typically you'll provide width, height, and [more…]

How to Build a Pattern on JavaScript's Canvas for HTML5 and CSS3 Programming

A pattern is used in JavaScript to define an image to be used as a fill or stroke. You can use any image on your HTML5 page as a pattern, but it's generally best to find or create an image that is designed [more…]

How to Use JavaScript's String Methods to Manipulate Text for HTML5 and CSS3 Programming

The length property is kind of cool, but the string object has a lot more up its sleeve. Objects also have methods. Strings in JavaScript have all kinds of [more…]

How to Use the Animation Loop on JavaScript’s Canvas for HTML5 and CSS3 Programming

An animation in JavaScript generally requires a special organization called an animation loop. The basic structure of the animation loop in HTML5 and CSS3 programming works the same in any language: [more…]

How to Build a Transformed Image on JavaScript's Canvas for HTML5 and CSS3 Programming

Transformations are math operations in JavaScript that can be applied to any drawing or image on you HTML5 and CSS3 page to change the appearance. There are three major transformations: [more…]

How to Draw Images on JavaScript's Canvas for HTML5 and CSS3 Programming

Although HTML has long had support for images, JavaScript's canvas interface adds new life to web images. Images can be displayed inside a canvas, where they can be integrated with the vector-drawing techniques [more…]

How to Draw Shapes on JavaScript's Canvas for HTML5 and CSS3 Programming

A few primitive shapes can be drawn directly onto the graphics context in JavaScript. The most common shapes for HTML5 and CSS3 programming that most web developers use are rectangles and text. [more…]

Listings:back...101-125126-129
Advertisement

Sign Up for RSS Feeds

Computers & Software
Win $500. Easy. Enter to win now.

Inside Dummies.com