- 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 6704 Articles for Javascript
669 Views
Adding semicolons after every function is optional. To avoid undesirable results, while using functions expressions, use a semicolon.Using semicolonvar display = function () { alert(“Hello World”); }; (function () { // code })();Without using semicolonvar display = function () { alert(“Hello World”); } (function () { // code })();The first function executes immediately since we have used the semicolon.
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)
9K+ 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
13K+ 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
5K+ 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”:
7K+ 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
19K+ 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
To Continue Learning Please Login
Login with Google