- 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
3K+ Views
In this tutorial, we will learn to convert seconds to Hours, Minutes, and Seconds (HHMM-SS) format in vanilla JavaScript. The date and time are an integral aspect of our daily lives; date and time are frequently used in computer programming. You might need to write a website in JavaScript with a calendar, a rail schedule, or an interface for scheduling appointments. So, for such purposes, JavaScript provides us with some inbuilt functions like the getTime() returns the number of milliseconds since January 1, 1970, 00:00:00. Using the toISOString() Method We might need to put seconds into a well-formatted structure to ... Read More
100 Views
The most basic way to track down errors is by turning on error information in your browser. By default, Internet Explorer shows an error icon in the status bar when an error occurs on the page. Double-clicking this icon takes you to a dialog box showing information about the specific error that occurred. Since this icon is easy to overlook, Internet Explorer gives you the option to automatically show the Error dialog box whenever an error occurs. To enable this option, select Tools → Internet Options → Advanced tab. and then finally check the "Display a Notification About Every Script Error" box option as ... Read More
2K+ Views
In this tutorial, we will learn to debug the JavaScript code using the Firefox web browser. Generally, we debug the code to fix the unknown bugs and errors. Mostly it happens with beginner programmers, code works successfully until the last night and suddenly crashes in the morning Programmers don’t need to worry now, even if code crashes. Once you learn to debug the code, you can fix any bugs in a few minutes and make it work fine If users want to learn to debug the code, the first step is to produce the code example with the error. So, ... Read More
477 Views
JavaScript provides a way to validate form's data on the client's computer before sending it to the web server. Basic form validation includes the form to be checked to make sure all the mandatory fields are filled in. It would require just a loop through each field in the form and check for data.ExampleYou can try to run the following code to implement basic form validation in JavaScript − Form Validation // Form validation function validate(){ if( document.myForm.Name.value ... Read More
240 Views
To catch exceptions in JavaScript, use try…catch…finally. JavaScript implements the try...catch...finally construct as well as the throw operator to handle exceptions.You can catch programmer-generated and runtime exceptions, but you cannot catch JavaScript syntax errors.ExampleYou can try to run the following code to learn how to catch exceptions in JavaScript − Live Demo Click the following to see the result:
17K+ Views
In this article, we will learn how to check the null values in JavaScript. The null value indicates the intentional absence of any object value. It is a JavaScript primitive value that is false when used in Boolean operations. This distinguishes null from the related primitive value undefined, which is an unintended absence of any object value. This is because a variable that has been declared but not given a value is undefined rather than null.You may visualize a variable as a box by using a real-world analogy. The box can hold things like a teapot, just like a variable ... Read More
2K+ Views
The onerror event handler was the first feature to facilitate error handling in JavaScript. The error event is fired on the window object whenever an exception occurs on the page.ExampleYou can try to run the following code to implement onerror() method in JavaScript − Click the following to see the result:
388 Views
In this tutorial, we will learn to use the throw statement in JavaScript. The “throw” is the reserved keyword in JavaScript, and Programmers can use the throw keyword to create the user-defined exception.Every programmer is not perfect, so they can’t write the JavaScript code without making a single error. It also happens that programmers are taking the input from the user, and an exception occurs if the user enters the invalid input. Some built-in exceptions include arithmetic exceptions, Index out-of-bound exceptions, etc. In some cases, programmers want to create their exception and can do it using the throw statement inside ... Read More
202 Views
There are three types of errors in programming: (a) Syntax Errors, (b) Runtime Errors, and (c) Logical Errors. Runtime errors, also called exceptions, occur during execution (after compilation/interpretation). For example, the following line causes a runtime error because here the syntax is correct, but at runtime, it is trying to call a method that does not exist. Exceptions also affect the thread in which they occur, allowing other JavaScript threads to continue normal execution.
174 Views
Syntax errors also called parsing errors, occur at compile time in traditional programming languages and at interpret time in JavaScript. For example, the following line causes a syntax error because it is missing a closing parenthesis. When a syntax error occurs in JavaScript, only the code contained within the same thread as the syntax error is affected and the rest of the code in other threads gets executed assuming nothing in them depends on the code containing the error.