JavaScript Articles
Check out these articles to discover tons of cool stuff that you can do with JavaScript code.
Articles From JavaScript
Filter Results
Cheat Sheet / Updated 03-03-2022
jQuery is a powerful and simple JavaScript library that you can use to select elements in your Web page, add impressive special effects, and insert content. Also find great resources for jQuery tips, tutorials, and plug-ins.
View Cheat SheetCheat 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 SheetCheat 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 SheetCheat Sheet / Updated 02-18-2022
JavaScript opens up Web pages to you so that you can add interactive features and those user-friendly touches. Of course, you have to know how to fit JavaScript into existing code and what to input to get the effects you want. And, when things aren't working well, you may need a little help troubleshooting the problem to get back on track.
View Cheat SheetStep 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 StepStep 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 StepArticle / 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 ArticleArticle / 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 ArticleArticle / Updated 03-26-2016
You can think of JavaScript as an extension to HTML; an add-on, if you will. Here's how it works. HTML tags create objects; JavaScript lets you manipulate those objects. For example, you use the HTML and tags to create a Web page, or document. As shown in Table 1, after that document is created, you can interact with it by using JavaScript. For example, you can use a special JavaScript construct called the onLoad event handler to trigger an action — play a little welcoming tune, perhaps — when the document is loaded onto a Web browser. Examples of other HTML objects that you interact with using JavaScript include windows, text fields, images, and embedded Java applets. Table 1: Creating and Working with Objects Object HTML Tag JavaScript Web page . . . document Image document.myImage HTML form . . . document.myForm Button document.myForm.myButton To add JavaScript to a Web page, all you have to do is embed JavaScript code in an HTML file. Below the line in which you embed the JavaScript code, you can reference, or call, that JavaScript code in response to an event handler or an HTML link. You have two choices when it comes to embedding JavaScript code in an HTML file: You can use the and tags to include JavaScript code directly into an HTML file. In the example below, a JavaScript function called processOrder() is defined at the top of the HTML file. Further down in the HTML file, the JavaScript function is associated with an event handler — specifically, the processOrder button's onClick event handler. (In other words, the JavaScript code contained in the processOrder() function runs when a user clicks the processOrder button.) <br /> // JavaScript statements go here<br /> function processOrder() {<br /> // More JavaScript statements go here<br /> }<br />... You can use the and tags to include a separate, external JavaScript file (a file containing only JavaScript statements and bearing a .js extension) into an HTML file. In the example below, the JavaScript processOrder() function is defined in the myJSfile.js file. The function is triggered, or called, when the user clicks the Click Here to Process Your Order link. <br />Click here to process your order.... Because Web pages aren't made of HTML alone, JavaScript provides access to more than just HTML objects. JavaScript also provides access to browser- and platform-specific objects. Browser plug-ins (such as RealPlayer and Adobe Acrobat), the name and version of a particular viewer's browser, and the current date are all examples of non-HTML objects that you can work with by using JavaScript. Together, all the objects that make up a Web site — HTML objects, browser- and platform-related objects, and special objects built right into the JavaScript language — are known as the document object model (DOM).
View ArticleArticle / 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