Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Web Development Articles
Page 541 of 801
How to include JavaScript in HTML Documents?
In this tutorial, we will learn how to include JavaScript in HTML Documents. To include JavaScript in HTML Documents, use the tag. JavaScript can be implemented using JavaScript statements that are placed within the ... . You can place the tags, containing your JavaScript, anywhere within your web page, but it is normally recommended that you should keep it within the tags. We will discuss the following three approaches to include JavaScript in HTML documents − Embedding code (within head or body) Inline Code (inside any ...
Read MoreWhat is the difference between JavaScript, JScript & ECMAScript?
JavaScript, JScript, and ECMAScript are closely related but serve different purposes in web development. Understanding their relationships helps clarify the JavaScript ecosystem. What is ECMAScript? ECMAScript is the official standard specification that defines the syntax, types, statements, keywords, and objects that scripting languages should implement. ECMA stands for European Computer Manufacturer's Association (now called Ecma International). ECMAScript serves as the blueprint that various implementations follow: // ECMAScript defines standard features like: let variable = "Hello World"; const PI = 3.14159; function greet(name) { return `Hello, ${name}!`; } What is ...
Read MoreHow do I get the current date in JavaScript?
To get the current date in JavaScript, you can use the Date object along with various methods to extract different parts of the date. Getting the Current Date Object The new Date() constructor creates a Date object representing the current date and time: var currentDate = new Date(); console.log(currentDate); 2024-01-15T10:30:45.123Z Getting the Day of the Month The getDate() method returns the day of the month (1-31): var date = new Date(); var dayOfMonth = date.getDate(); console.log("Day of month: " + dayOfMonth); Day of month: 15 ...
Read MoreWhere is JavaScript Today?
JavaScript has evolved significantly since its creation in 1995. Today, it stands as one of the most popular and versatile programming languages in the world, powering everything from simple web interactions to complex server applications and mobile apps. Current JavaScript Standard The latest JavaScript standard is ECMAScript 2023 (ES14), released in June 2023. However, ECMAScript 2017 (ES8) remains widely supported and includes major features like async/await, Object.entries(), and string padding methods. The ECMA-262 Specification continues to define the core JavaScript language standards. JavaScript's Modern Role JavaScript is no longer limited to browser-based interactions. It has expanded ...
Read MoreHow to check whether a string contains a substring in JavaScript?
JavaScript provides us with different methods to check whether a string contains a substring or not. In this article, we use the following three methods for this purpose: String search() method String indexOf() method String includes() method Let's explore in detail each method. Using String search() Method The string search() method can be used to search a text (using regular expression) in a string. It matches the string against a regular expression and returns the index (position) of the first match. It returns -1 if no match is found. It's case-sensitive. The ...
Read MoreWhat are some JavaScript Development Tools?
One of the major strengths of JavaScript is that it does not require any expensive development tools. You can start with a simple text editor such as Notepad. Since it is an interpreted language inside the context of a web browser, you don't even need to buy a compiler. To make our lives simpler, various vendors have come up with very nice JavaScript editing tools. Some of them are listed here − Code Editors and IDEs A quality code editor is the backbone of any JavaScript development process. Visual Studio Code ...
Read MoreWhat are the advantages of JavaScript?
JavaScript is a dynamic computer programming language. It is lightweight and most commonly used as a part of web pages, whose implementation allows a client-side script to interact with a user and to make dynamic pages. It is an interpreted programming language with object-oriented capabilities. Client-Side (Browser) DOM Manipulation User Interaction Form Validation Dynamic Content ...
Read MoreWhat is core JavaScript language?
Core JavaScript is the foundation of the JavaScript language that provides the essential programming constructs and features. It represents the standard language specification that works consistently across different environments, whether in browsers, servers, or other JavaScript runtime environments. What is Core JavaScript? Core JavaScript includes the fundamental language features such as variables, data types, operators, control structures, functions, and objects. These core elements remain the same regardless of where JavaScript is executed. // Core JavaScript features work everywhere let name = "JavaScript"; let version ...
Read MoreHow and why to avoid global variables in JavaScript?
Avoiding global variables in JavaScript is a fundamental best practice for writing maintainable and bug-free code. Global variables can be easily overwritten by other scripts and create naming conflicts that lead to unexpected behavior. Why Avoid Global Variables? Global variables create several problems in JavaScript applications: Naming Conflicts: Multiple scripts can accidentally use the same variable names Maintenance Issues: Hard to track where variables are modified Memory Leaks: Global variables persist throughout the application lifecycle Testing Difficulties: Global state makes unit testing more complex Problem Example // Global variables - problematic approach ...
Read MoreWhich is the best tutorial site to learn JavaScript?
JavaScript is a dynamic computer programming language. It is lightweight and most commonly used as a part of web pages, whose implementations allow a client-side script to interact with the user and make dynamic pages. It is an interpreted programming language with object-oriented capabilities. Why Choose TutorialsPoint for JavaScript Learning? TutorialsPoint offers comprehensive JavaScript tutorials that cover everything from basics to advanced concepts. The JavaScript tutorial is structured to provide step-by-step learning with practical examples. Core JavaScript Topics Covered The tutorial explains fundamental JavaScript concepts including: Overview - Understanding JavaScript's ...
Read More