Category: Miscellaneous
-
JSON
What is JSON? JSON (JavaScript Object Notation) is a text-based data format used to represent objects and data structures. It is language-independent, meaning that it can be used with any programming language. JSON is often used to exchange data between a server and a web application, or between two different web applications. JSON Features JSON…
-
Browsers Compatibility
It is important to understand the differences between different browsers in order to handle each in the way it is expected. So it is important to know which browser your web page is running in. To get information about the browser your webpage is currently running in, use the built-in navigator object. Navigator Properties There are several…
-
Image Map
You can use JavaScript to create client-side image map. Client-side image maps are enabled by the usemap attribute for the <img /> tag and defined by special <map> and <area> extension tags. The image that is going to form the map is inserted into the page using the <img /> element as normal, except that it carries…
-
Multimedia
The JavaScript navigator object includes a child object called plugins. This object is an array, with one entry for each plug-in installed on the browser. The navigator.plugins object is supported only by Netscape, Firefox, and Mozilla only. Example Here is an example that shows how to list down all the plug-on installed in your browser − <html><head><title>List of…
-
Animation
You can use JavaScript to create a complex animation having, but not limited to, the following elements − You might be interested in existing JavaScript based animation library: Script.Aculo.us. This tutorial provides a basic understanding of how to use JavaScript to create an animation. JavaScript can be used to move a number of DOM elements (<img…
-
Form Validation
Form validation normally used to occur at the server, after the client had entered all the necessary data and then pressed the Submit button. If the data entered by a client was incorrect or was simply missing, the server would have to send all the data back to the client and request that the form…
-
Page Printing
Many times you would like to place a button on your webpage to print the content of that web page via an actual printer. JavaScript helps you to implement this functionality using the print function of window object. The JavaScript print function window.print() prints the current web page when executed. You can call this function directly using the onclick event as shown in…
-
Dialog Boxes
JavaScript supports three important types of dialog boxes. These dialog boxes can be used to raise and alert, or to get confirmation on any input or to have a kind of input from the users. Here we will discuss each dialog box one by one. Alert Dialog Box An alert dialog box is mostly used…
-
Page Redirection
What is Page Redirection? You might have encountered a situation where you clicked a URL to reach a page X but internally you were directed to another page Y. It happens due to page redirection. This concept is different from JavaScript Page Refresh. There could be various reasons why you would like to redirect a user from…
-
Rest Parameter
Rest Parameter The rest parameter in JavaScript allows a function to accept a variable number of arguments as an array. When the number of arguments that need to pass to the function is not fixed, you can use the rest parameters. The JavaScript rest parameters allow you to collect all the remaining arguments in a single array.…