- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 10877 Articles for Web Development
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.
33K+ 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
377 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);
737 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
12K+ 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
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
984 Views
In this tutorial, we will learn to load a JavaScript function using the name of a variable. Functions are the block of statements that takes an input and displays the result to the user after an execution. We can use these blocks of codes repeatedly by only declaring the function, and these functions can help a programmer in many ways as it also reduces efforts. JavaScript also supports the use of functions like other programming languages. Functions in JavaScript can be either built-in or user-defined. There are different ways to declare a function and call it. Generally, a simple Function ... Read More
977 Views
To hide a div when the user clicks outside of it, try to run the following codeExampleLive Demo window.onload = function(){ var hideMe = document.getElementById('hideMe'); document.onclick = function(e){ if(e.target.id !== 'hideMe'){ hideMe.style.display = 'none'; } }; }; Click outside this div and hide it.
223 Views
decodeURIComponentTo decode a URL component in JavaScript, use the decodeURLComponent() method.ExampleYou can try to run the following code to decode a URL component − Check function display() { var uri = "http://example.com/welcome msg.jsp?name=åmit&sub=programming"; // first encode var encode = encodeURIComponent(uri); var decode = decodeURIComponent(encode); var result = "Encode= " + ... Read More
117 Views
In JavaScript, use any of the single or double quotes for a string. However, you should be consistent in whatever you select. Single and double quotes are the same in JavaScript −"Let us say: \"Life's good!\"" 'Let us say: "Life\'s good!"' “Let us say: \"Life\'s good!\"" 'Let us say: \"Life\'s good!\"'Let’s see an example, which is supported by ES6 −`Will you be "my" friend. I really liked it when I was a kid,.`;
To Continue Learning Please Login
Login with Google