Found 10483 Articles for Web Development

What are the different types of DOM available to access and modify content in JavaScript?

Shubham Vora
Updated on 15-Nov-2022 10:54:22

1K+ Views

In this tutorial, we will learn what are the different types of DOM available to access and modify content in JavaScript. The Document Object Model (DOM) is a data representation of the objects that form the structure and content of a web document. It is an interface for scripting web pages. Programs can alter the document’s structure, style, and content by utilizing the DOM. The DOM represents each element as a node, and the programming languages like JavaScript can easily interact with the nodes to modify the page. There are different types of DOM available to access and modify content ... Read More

What are the three types of errors I can expect in my JavaScript script?

Shubham Vora
Updated on 31-Oct-2022 11:21:36

485 Views

In this tutorial, let us discuss the three types of errors we can expect in our JavaScript code. Errors are statements that block the execution of the program. During the compilation of the program, three types of errors can occur. These are syntax errors, run time errors, and logical errors. Syntax Errors Syntax errors are usual errors. Incorrect syntax causes parsing issues during the code interpretation. For example, add a semicolon instead of a colon in an object declaration. Syntax errors affect only the respective code thread. The remaining code works as it is. A grammatical mistake is the ultimate ... Read More

How to play a multimedia file using JavaScript?

Shubham Vora
Updated on 15-Sep-2022 12:02:02

1K+ Views

In this tutorial, we will learn how to play a multimedia file using JavaScript. The multimedia file is the audio and video files. The multimedia files can be of different formats. wav and mp3 are two examples of audio file formats, whereas mp4 and mkv are examples of video file formats. In HTML, multimedia files can be shown easily using different tags. We use the video tag for showing a video, and for audio, we use the audio tag. These two tags are quite similar, and many attributes are the same in both tags. The "src" attribute defines the path ... Read More

What is a Document Object Model?

Priya Pallavi
Updated on 18-May-2020 08:47:22

759 Views

A Document object represents the HTML document that is displayed in that window. The Document object has various properties that refer to other objects, which allow access to and modification of document content.The way a document content is accessed and modified is called the Document Object Model, or DOM. The Objects are organized in a hierarchy. This hierarchical structure applies to the organization of objects in a Web document.Window object − Top of the hierarchy. It is the utmost element of the object hierarchy.Document object − Each HTML document that gets loaded into a window becomes a document object. The document ... Read More

What does a JavaScript plugin consist of?

Shubham Vora
Updated on 31-Oct-2022 11:24:48

3K+ Views

In this tutorial, we will discuss plugins in JavaScript. So what is a plugin? A plugin is a JavaScript code written in a file. This file supplies various methods that we can use for various purposes. A plugin has an entry in the array. An entry has following properties − name − The name is the plugin name. filename − filename is the executable file loaded to install the plugin with the extension. description − description is the developer's(manufacturer's) description of the plugin. mimeTypes − mimeTypes is an array with one entry for each MIME type that the plugin ... Read More

How to list down all the plug-in installed in your browser?

Nitya Raut
Updated on 23-Jun-2020 06:55:20

1K+ Views

To list down all the plug-on installed in the web browser, use the JavaScript navigator object. 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.ExampleYou can try to run the following code to list down all the plug-in installed in your browser −           List of Plug-Ins                                       Plug-in Name             Filename             Description                                 for (i = 0;  i < navigator.plugins.length;  i++)             {                document.write("");                document.write(navigator.plugins[i].name);                                document.write("");                document.write(navigator.plugins[i].filename);                                document.write("");                document.write(navigator.plugins[i].description);                document.write("");             }                    

How to differentiate between Manual and Automated Animation in JavaScript?

Shubham Vora
Updated on 26-Oct-2022 07:38:22

556 Views

Generally, animation in JavaScript is done to get different effects and make the object move around the page. You can move and animate any type of HTML element using manual or automated animations in JavaScript. In this tutorial, we will learn how to differentiate between manual and automated animation in JavaScript. Manual Animation Before explaining the difference between the two common types of animation used in JavaScript, we must learn the process of animating objects manually. Under Manual Animation, the animation process is not automated. The following is the implementation of a simple animation using DOM object properties and ... Read More

What is the role of clearTimeout() function in JavaScript?

Srinivas Gorla
Updated on 23-Jun-2020 06:55:51

282 Views

If you have set a time using setTimeout() function, then you can clear it using the JavaScript clearTimeout() function.ExampleYou can try to run the following code learn how to implement clearTimeout() function in JavaScript −           JavaScript Animation                                                        Click the buttons below to handle animation                              

What are different Navigator methods available?

Jennifer Nicholas
Updated on 23-Jun-2020 06:56:24

211 Views

You can use several Navigator related properties in your web page. The following are the properties −Sr.NoProperties & Description1javaEnabled()This method determines if JavaScript is enabled in the client. If JavaScript is enabled, this method returns true; otherwise, it returns false.2plugings.refreshThis method makes newly installed plug-ins available and populates the plugins array with all new plug-in names. Netscape only.3preference(name, value)This method allows a signed script to get and set some Netscape preferences. If the second parameter is omitted, this method will return the value of the specified preference; otherwise, it sets the value. Netscape only.4taintEnabled()This method returns true if data tainting ... Read More

When to use anonymous JavaScript functions?

Vrundesha Joshi
Updated on 23-Jun-2020 06:58:06

302 Views

The code while using anonymous functions is more readable when handlers are to be defined inside the calling code. Anonymous functions are declared inline. Normally, inline functions are better since they can access variables in the parent scopes.It allows for creating a function without any names identifier. It can be used as an argument to other functions. You can call them using a variable name.This is how JavaScript anonymous functions can be used −var func = function() {    alert(‘This is anonymous'); } func();Here’s an example −//anonymous function var a = function() {    return 5; }

Advertisements