Found 10711 Articles for Web Development

What is Addition Assignment Operator (+=) in JavaScript?

Nitya Raut
Updated on 13-Jun-2020 08:19:32

133 Views

It adds the right operand to the left operand and assigns the result to the left operand.ExampleYou can try to run the following code to learn how to work with Addition Assignment Operator −                    var a = 33;          var b = 10;          document.write("Value of a => (a += b) => ");          result = (a += b);          document.write(result);          document.write(linebreak);          

What is Multiplication Operator (*) in JavaScript?

Abhishek
Updated on 08-Nov-2022 06:37:42

357 Views

In this tutorial, we will learn about the multiplication operator (*) in JavaScript. The multiplication operator is a binary operator which requires at least two operands to operate on. The multiplication operator simply multiplies the left operand with the right operand, or you can say that it simply increases the value of the left operand with the same value till the value of the right operand becomes zero. The example below will explain you everything − 3 * 2 = 6 OR 3 + 3 = 6 5 * 3 = 15 OR 5 + 5 + 5 = 15 ... Read More

What is Modulus Operator (%) in JavaScript?

Abhishek
Updated on 25-Nov-2022 08:07:45

1K+ Views

In this tutorial, we will learn about the modulus operator in JavaScript. In some languages, the modulus operator is also known as the remainder operator. The remainder operator and the modulus operator both are used to get the remainder of an integer when it is divided by some other integer, but they are different from each other in case of signs of the remainder whether it has to be positive or negative that is returned after the division. In the expression a % b, a is called dividend, while b is known as divisor. In case of the modulo, the ... Read More

How to make a page redirect using jQuery?

Smita Kapse
Updated on 12-Jun-2020 12:20:30

818 Views

To redirect to another webpage in jQuery, use attr(). You can try to run the following code to redirect to another webpage −Example                                $(document).ready(function() {             $(location).attr('href','http://qries.com');          });                  

How to redirect website after certain amount of time without JavaScript?

Anvi Jain
Updated on 08-Jan-2020 07:06:18

4K+ Views

To redirect from an HTML page, use the META Tag. With this, use the http-equiv attribute to provide an HTTP header for the value of the content attribute. The value of the content is the number of seconds; you want the page to redirect after.Through this, you can automatically redirect your visitors to a new homepage. Set the content attribute to 0, if you want it to load immediately.ExampleThe following is an example of redirecting current page to another page after 2 seconds.Live Demo           Redirection                     This page will redirect in 2 seconds.    

How to use JavaScript to redirect a webpage after 5 seconds?

Abhishek
Updated on 08-Sep-2023 23:14:24

35K+ Views

In this tutorial, we learn to use JavaScript to redirect a webpage after 5 seconds. To redirect a webpage after 5 seconds, use the setInterval() method to set the time interval. Add the webpage in window.location.href object. As we know, whenever we need to call a function or some block of code after a specific delay of time we use the setTimeout() and the setInterval() methods of JavaScript. Lts look at the use of these methods to redirect a web page by 5 seconds. To redirect a page we will use the document.location.href or window.location.href object of JavaScript as shown ... Read More

What is unsigned Right Shift Operator (>>>) in JavaScript?

Nancy Den
Updated on 13-Jun-2020 07:41:03

400 Views

This operator is just like the >>operator, except that the bits shifted in on the left are always zero i.e. xeroes are filled in from the left.ExampleYou can try to run the following code to learn how to work with unsigned right shift operator −                    var a =-14;          var b =2; // Shift right two bits          document.write("(a >>> b) => ");          result =(a >>> b);          document.write(result);          

What is the difference between == and === in JavaScript?

Daniol Thomas
Updated on 18-Sep-2019 08:25:09

788 Views

Double equals (==) is abstract equality comparison operator, which transforms the operands to the same type before making the comparison. For example,4    ==  4        // true '4'  ==  4        //true 4    == '4'       // true 0    == false     // trueTriple equals (===) are strict equality comparison operator, which returns false for different types and different content.For example,4 === 4  // true 4 === '4' // false var v1 = {'value':'key'}; var v2 = {'value': 'key'}; v1 === v2 //false

How to use JavaScript to load a webpage after 5 seconds?

Abhishek
Updated on 25-Nov-2022 07:20:43

13K+ Views

In this tutorial, we learn to use JavaScript to load a webpage after 5 seconds. We use the setTimeout() function in JavaScript to load a webpage after some interval. This function waits for some seconds and then loads the web page. We could also apply the setInterval() method to perform our task. Generally, a web page loads immediately if the network connection to which user connected is very strong, and if the network connection is very poor, then it will take some time to load. But did you know that, we can stop the web page loading for some time ... Read More

How to validate URL address in JavaScript?

Shubham Vora
Updated on 23-Nov-2022 13:50:26

2K+ Views

In this tutorial, let us discuss how to validate URL addresses in JavaScript. A URL or Uniform Resource Locator identifies web pages, images, and videos on the internet. URLs are website addresses that transfer files, send emails, and many more. URLs consist of a protocol, domain name, and so on. URL indicates how the browser gets the data and where to get the data. We use a URL in the anchor tags or buttons to navigate the user to another location. We must verify the URL's validity before using it. URL Rule URL must start with http:// or https://. ... Read More

Advertisements