Eva Holland

Chris Minnick and Eva Holland are experienced web developers, tech trainers, and coauthors of Coding with JavaScript For Dummies. Together they founded WatzThis?, a company focused on training and course development.

Articles From Eva Holland

page 1
page 2
page 3
page 4
page 5
page 6
page 7
page 8
page 9
84 results
84 results
Using Polyfills to Code with JavaScript

Article / Updated 08-02-2022

HTML5 brings some pretty amazing new functionality to JavaScript web pages, and the HTML 5 APIs are rapidly giving web browsers access to new universes of data and making installable computer applications a thing of the past. However, not every browser is on board with the future yet. Or, not every browser can agree on what that future should be. As a result, it’s quite possible, and quite common to want to use a particular HTML tag or API and find that it just doesn’t work in some browsers. Fortunately, some ingenious folks have come up with a strategy, called polyfills, for implementing features in browsers that don’t yet support them. Modernizr is a JavaScript library that detects whether a browser supports features of HTML5 and CSS3. A typical way to use a polyfill is to first detect whether the user’s browser supports the feature in question, using Modernizr, and then use the polyfill if not. To install Modernizr, select the particular tests that you'll be using in your web application, and build a custom version of the library that you can then import into your website using the script element. Modernizr uses a simple syntax to select between different paths based on whether a user’s browser supports a feature. For example, here’s a Modernizr test that checks for geolocation support: Modernizr.load({ test: Modernizr.geolocation, yep : 'geo.js', nope: 'geo-polyfill.js' }); A common case in which you would want to use a polyfill is with video. The HTML5 video element allows browsers to play videos without using any plugins. However, different browsers require different video formats, and some older browsers don’t support the video element at all. In order to smooth over these differences, you can include and use a JavaScript polyfill called MediaElement.js. To use it, you can simply download and include the appropriate JavaScript and CSS files and include the following script elements in the head of your document: <script src="jquery.js"></script> <script src="mediaelement-and-player.min.js"></script> <link rel="stylesheet" href="mediaelementplayer.css" /> Then, using just a single video file in any browser can be as simple as just using the video element and specifying a single .mp4 source file. <video src="myvideo.mp4" width="320" height="240"></video> If the browser doesn’t support the video element or this format, a Flash video player will be used as a backup. Polyfills exist for nearly every new HTML5 feature. A complete list of polyfills is maintained by Modernizr.

View Article
Coding All-in-One For Dummies Cheat Sheet

Cheat Sheet / Updated 06-30-2022

Coding is equal parts vocabulary, logic, and syntax. Coding may at first seem intimidating, but with practice, though, it's easy to get comfortable with its terminology, concepts, and structure. Understanding coding is not unlike learning a new language: Use it often enough and you'll find yourself able to speak, think, and write in code. Still, it's natural for beginners to have questions. There are many coding resources available to you, both on- and off-line. Ask around and you'll find you're not alone — many other people are learning. After all, coding is a never-ending education. Master one facet or another and a new one opens in front of you.

View Cheat Sheet
Coding with JavaScript For Dummies Cheat Sheet

Cheat Sheet / Updated 03-03-2022

Master coding with JavaScript by discovering which words are reserved in JavaScript, an extensive list of HTML5 APIs, and jQuery selectors. Just check out these helpful tips to get started.

View Cheat Sheet
JavaScript For Kids For Dummies Cheat Sheet

Cheat Sheet / Updated 02-25-2022

When you’re programming in JavaScript, you need to know how to convert CSS property names to JavaScript. An important part of JavaScript’s ability to perform useful functions in the browser is its ability to respond to events, including those listed here. Finally, some words cannot be used as JavaScript variables, functions, methods, loop labels, or object names; those reserved words are listed here.

View Cheat Sheet
10 Online Tools to Help You Write Better JavaScript

Step by Step / Updated 03-07-2017

JavaScript has more libraries, resources, and helpful tools for working with it than for any other programming language. Here are ten of the best resources for helping you write more and better JavaScript.

View Step by Step
10 JavaScript Frameworks and Libraries to Learn Next

Step by Step / Updated 01-26-2017

You’ve only just begun your JavaScript journey. The universe of tools, frameworks, and libraries built with JavaScript and that will help you write better JavaScript programs is vast and growing at a mind-boggling pace. Here are ten great JavaScript frameworks and libraries.

View Step by Step
JavaScript Reserved Words

Article / Updated 01-24-2017

When coding with JavaScript, it will benefit you to know certain reserved words. The following list contains JavaScript reserved words. You can’t use these words as JavaScript variables, functions, methods, loop labels, or object names. abstract final public boolean finally return break float short byte for static case function super catch goto switch char if synchronized class implements this const import throw continue in throws debugger instanceof transient default int true delete interface try do long typeof double native var else new void enum null volatile export package while extends private with false protected

View Article
What Are JavaScript Reserved Words?

Article / Updated 01-24-2017

JavaScript has some reserved words you should know before you begin coding. The following table contains a list of JavaScript reserved words, which cannot be used as JavaScript variables, functions, methods, loop labels, or object names. abstract boolean break byte case catch char class const continue debugger default delete do double else enum export extends false final finally float for function goto if implements import in instanceof int interface long native new null package private protected public return short static super switch synchronized this throw throws transient true try typeof var void volatile while with

View Article
List of HTML5 APIs for Coding with JavaScript

Article / Updated 03-26-2016

Here is an extensive list of HTML5 APIs that have either been proposed or implemented. Browsers are constantly being updated with new features. For the latest on which browsers support which features, visit caniuse.com. API What It Does Ambient Light API Provides information about the ambient light levels, as detected by a device’s light sensor. Battery Status API Provides information about the battery status of the device. Canvas 2D Context Allows drawing and manipulation of graphics in a browser. Clipboard API Provides access to the operating system’s copy, cut, and paste functionality. Contacts Allows access to a user’s contacts repository in the web browser. Drag and Drop Supports dragging and dropping items within and between browser windows. File API Provides programs with secure access to the device’s file system. Forms Gives programs access to the new data types defined in HTML5. Fullscreen API Controls the use of the user’s full screen for web pages, without the browser user interface. Gamepad API Supports input from USB gamepad controllers. Geolocation Provides web applications with access to geographical location data about the user’s device. getUserMedia/Stream API Provides access to external device data (such as webcam video). History API Allows programs to manipulate the browser history. HTML Microdata Provides a way to annotate content with computer-readable labels. Indexed database Creates a simple client-side database system in the web browser. Internationalization API Provides access to locale-sensitive formatting and string comparison. Offline apps Allows programmers to make web apps available in offline mode. Proximity API Provides information about the distance between a device and an object. Screen Orientation Reads the screen orientation state (portrait or landscape) and gives programmers the ability to know when it changes and to lock it in place. Selection Supports selecting elements in JavaScript using CSS-style selectors. Server-sent events Allows the server to push data to the browser without the browser needing to request it. User Timing API Gives programmers access to high-precision timestamps to measure the performance of applications. Vibration API Allows access to the vibration functionality of the device. Web Audio API API for processing and synthesizing audio. Web Messaging Allows browser windows to communicate with each other across different origins. Web Speech API Provides speech input and text-to-speech output features. Web storage Allows the storage of key-value pairs in the browser. Web sockets Opens an interactive communication session between the browser and server. Web Workers Allows JavaScript to execute scripts in the background. XMLHttpRequest2 Improves XMLHttpRequest to eliminate the need to work around the same-origin policy errors and to make XMLHttpRequest work with new features of HTML5.

View Article
jQuery Selectors for Coding with JavaScript

Article / Updated 03-26-2016

JQuery provides many different ways to match sets of elements within a document beyond the methods built into JavaScript. Check out this list of all the jQuery selectors. To use them, simply pass them to the jQuery function (or, you can use the $ alias for the jQuery function). For example: $("*") selects every element. $("div p:first-child") selects the first paragraph child of each matched div element. $("div:contains('We hold these truths')") selects the divs that contain the matching text. Check here to see examples of each of these jQuery selectors inside programs. Selector What It Selects All Selector (“*”) All elements. :animated Selector All elements that are animated at the time of selection. Attribute Contains Prefix Selector [name|="value"] Elements that have the specified attribute with a value either equal to a given string or starting with that string followed by a hyphen (-). Attribute Contains Selector [name*="value"] Elements that have the specified attribute with a value containing a given substring. Attribute Contains Word Selector [name~="value"] Elements that have the specified attribute with a value containing a given word, delimited by spaces. Attribute Ends With Selector [name$="value"] Elements that have the specified attribute with a value ending exactly with a given string. The comparison is case sensitive. Attribute Equals Selector [name="value"] Elements that have the specified attribute with a value exactly equal to a certain value. Attribute Not Equal Selector [name!="value"] Elements that either don’t have the specified attribute or do have the specified attribute but not with a certain value. Attribute Starts With Selector [name^="value"] Elements that have the specified attribute with a value beginning exactly with a given string. :button Selector All button elements and elements of type button. :checkbox Selector Elements of type checkbox. :checked Selector All elements that are checked or selected. Child Selector (“parent > child”) All direct child elements specified by “child” of elements specified by “parent”. Class Selector (“.class”) Elements with the given class. :contains() Selector Elements that contain the specified text. Descendant Selector (“ancestor descendant”) Elements that are descendants of a given ancestor. :disabled Selector Elements that are disabled. Element Selector (“element”) Elements with the given tag name. :empty Selector Elements that have no children (including text nodes). :enabled Selector Elements that are enabled. :eq() Selector The element at index n within the matched set. :even Selector Even elements, zero-indexed. See also odd. :file Selector Elements of type file. :first-child Selector Elements that are the first child of their parent. :first-of-type Selector Elements that are the first among siblings of the same element name. :first Selector The first matched element. :focus Selector The element that is currently focused. :gt() Selector Elements at an index greater than index within the matched set. Has Attribute Selector [name] Elements that have the specified attribute, with any value. :has() Selector Elements which contain at least one element that matches the specified selector. :header Selector Elements that are headers, like h1, h2, h3, and so on. :hidden Selector Elements that are hidden. ID Selector ("#id") A single element with the given id attribute. :image Selector Elements of type image. :input Selector All input, textarea, select, and button elements. :lang() Selector Elements of the specified language. :last-child Selector Elements that are the last child of their parent. :last-of-type Selector Elements that are the last among siblings of the same element name. :last Selector The last matched element. :lt() Selector Elements at an index less than index within the matched set. Multiple Attribute Selector [name="value"][name2="value2"] Elements that match all the specified attribute filters. Multiple Selector (“selector1, selector2, selectorN”) The combined results of all the specified selectors. Next Adjacent Selector (“prev + next”) All next elements matching “next” that are immediately preceded by a sibling “prev”. Next Siblings Selector (“prev ~ siblings”) All sibling elements that follow after the “prev” element, have the same parent, and match the filtering “siblings” selector. :not() Selector Elements that do not match the given selector. :nth-child() Selector Elements that are the nth-child of their parent. :nth-last-child() Selector Elements that are the nth-child of their parent, counting from the last element to the first. :nth-last-of-type() Selector All the elements that are the nth-child of their parent in relation to siblings with the same element name, counting from the last element to the first. :nth-of-type() Selector Elements that are the nth child of their parent in relation to siblings with the same element name. :odd Selector Odd elements, zero-indexed. See also even. :only-child Selector Elements that are the only child of their parent. :only-of-type Selector Elements that have no siblings with the same element name. :parent Selector Elements that have at least one child node (either an element or text). :password Selector Elements of type password. :radio Selector Elements of type radio. :reset Selector Elements of type reset. :root Selector The element that is the root of the document. :selected Selector Elements that are selected. :submit Selector Elements of type submit. :target Selector The target element indicated by the fragment identifier of the document’s URI. :text Selector All input elements of type text. :visible Selector Elements that are visible.

View Article
page 1
page 2
page 3
page 4
page 5
page 6
page 7
page 8
page 9