
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- 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 6710 Articles for Javascript

2K+ Views
The following global error handler will show how to catch unhandled exception −Example window.onerror = function(errMsg, url, line, column, error) { var result = !column ? '' : 'column: ' + column; result += !error; document.write("Error= " + errMsg + "url= " + url + "line= " + line + result); var suppressErrorAlert = true; return suppressErrorAlert; }; setTimeout(function() { eval("{"); }, 500)

11K+ Views
In this tutorial, we will learn to center a popup window on the screen using JavaScript. Programmers often need to open a new popup window to show another webpage without redirecting the user to the other webpage. In this situation, developers use the window.open() method to open the new browser window. Also, we can style the popup window and set the height and width. Also, we can change the position of the popup window to look it better. Sample Popup Window In this section, we will create a sample popup window to get familiar with the how window.open() method works. ... Read More

16K+ Views
JavaScript is the core of any website, it adds functionalities to a website, make the overall website responsive. But in JavaScript, it is hard to select an element and add different functions like toggling an element, fade-in an element, and more. jQuery provides many methods for making it easy to add functionality to a website like fade-in, fade-out, hide, show, toggle, etc. Concatenating jQuery and JavaScript makes it easy to use the jQuery function in JavaScript function whenever needed, instead of calling them separately. Syntax To call a jQuery function with a JavaScript function, you can use the following syntax ... Read More

6K+ Views
JavaScript cannot call java method directly since it is on the server. You need a Java framework like JSP to call when a request is received from JavaScript. Let’s see how to use JSP to call a Java function inside JavaScript function.Here’s the JavaScript code://javascript code function initiateFunc() { $.get('localhost/project/myexecution.jsp); } $( initiateFunc); Here’s the JSP code for “myexecution.jsp”:

10K+ Views
We use the dialog API of jQuery UI to show hyperlinks in JavaScript alerts. JavaScript does not allow putting clickable hyperlinks in the alert box. The closest functionality that plain JavaScript provides is a confirm box using the window.confirm() method. We will be using the jQuery library to show hyperlinks in JavaScript alerts. It is a library for JavaScript to traverse HTML documents as well as manipulate them, create animations, and much more. One such feature is a custom dialog box that we will be using. An alert is a message for the user that requires immediate attention. An alert ... Read More

21K+ Views
In this tutorial, we will learn how to validate an email address using JavaScript. A computer network's electronic mailbox, often known as an email address, is used to send and receive messages. All email addresses have the same format as in the 1980s. The email validation process checks to see if an email address is deliverable and legitimate. It quickly executes an algorithm that detects different typos and also whether there are deliberate misdirection or innocent errors. It verifies like Gmail or Yahoo if a certain email address is registered with such reputable domain or not. This increases the effectiveness ... Read More

1K+ Views
This tutorial teaches us to convert the arguments object to array in JavaScript. Before we proceed with the tutorial, let’s look at the arguments object. In JavaScript, every function contains the ‘arguments’ object. It includes the values of all arguments we passed while calling or invoking the function.It is very similar to an array, but it is not an actual array.The ‘arguments’ object has a length property, and we can use it to know how many arguments are passed during the function call.We can access all values of the ‘arguments’ object like an array index property. For example, arguments[0] give ... Read More

833 Views
Arguments object is the arguments passed to a function. It is a variable accessible for all functions. Let’s say two arguments are passed to a function, then you can access them like the following:arguments[0] arguments[1]In the same way, you can use a type of with arguments in JavaScript. Firstly, let’s see how to work with the type of. The type of operator is a unary operator that is placed before its single operand, which can be of any type. ExampleThe following code shows how to implement type of operatorLive Demo var ... Read More

236 Views
Arguments object in JavaScript is an object, which represents the arguments to the function executing. Its syntax has two arguments:[function.]arguments[p]ExampleYou can try to run the following code to learn what are arguments object in JavaScriptLive Demo function functionArgument(val1, val2, val3) { var res = ""; res += "Expected Arguments: " + functionArgument.length; res += ""; res += "Current Arguments : " + arguments.length; res += ""; res += "Each argument = " for (p = 0; p < arguments.length; p++) { res += ""; res += functionArgument.arguments[p]; res += " "; } document.write(res); } functionArgument(20, 50, 80, "Demo Text!","Hello World", new Date())