0% found this document useful (0 votes)
7 views10 pages

JavaScript Basics and Script Tag Usage

Uploaded by

mmani05199
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views10 pages

JavaScript Basics and Script Tag Usage

Uploaded by

mmani05199
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

Java Script And

Script Tag

BY: [Link]
[Link] COMPUTER SCIENCE (III
YEAR)
 Java script
java script is a browser side script
language .
java script is light weight
programming language.
java script is embedded directly into
HTML pages.
java script is an interpreted language
[ script execute without preliminary
compilation]
 History of java script
in 1995 java script was created bay a net scope developer
, named Brendan Eich first its name was Mocha and then ,it name was changed
to live script.
 java script has no standards that governed its syntax and feature, and the
community decided that it was time to standardize the language.

Technical committee #39(tc 39) was assigned to standardize the language to


make it a general purpose , cross platform , and vendor-neutral scripting language.

In 1997, Java script 1.1 was submitted to the European computer manufacture
association(ECMA)as a proposal.

Tc39 came up with ECMA 262 a standard for defining a new scripting
language named ECMA script(often pronounced EK ma script
 Java script engine
Java Script Can Do

 Manipulating HTML elements


 User Interaction
 Server Interaction
 Create a new elements
 Delete existing elements
 Modify existing elements
 Reacts on user’s action
 Access browser’s cookies and local storages
Java Script Can’t Do
 Java Script on a webpage may not readd/write files on the hard disk, copy them or
execute programs. It has no direct access to OS function.
 Java Script form one page may not access the other if they come from different
sites(from a different, domain ,protocol or port)

What makes java script unique


 Full integration with HTML/CSS
 Simply things are done simply
 Supported by all major browser and enabled by default
Script Tag
 The HTML<SCRIPT> tag embeds client-side script or links to
external java script files, enabling dynamic content, , form
validation and style manipulation. Attributes like async, defer and
src control script execution and loading, enhancing of web pages.
Syntax:
//For internal java script linking
<script>script contents……
</script>
//For external java script linking
<script src=“[Link]”>
</script>
[Link] Attributes Descriptions

01 Async It is used to specify the scripty is executed


asynchronously.

02 Defer It used to specify that the script is executed when


the page has finished parsing

03 It used to specify the URL of an external script file


THANK YOU

Common questions

Powered by AI

JavaScript initially lacked standards governing its syntax and features, leading to the community's decision to standardize it. Technical committee #39 (TC39) was tasked with this responsibility. In 1997, JavaScript 1.1 was submitted to the European Computer Manufacturers Association (ECMA) as a proposed standard. TC39 developed ECMA-262, which defined a new scripting language named ECMAScript. This process made JavaScript a general-purpose, cross-platform, and vendor-neutral scripting language .

JavaScript manipulates HTML and CSS to create dynamic web pages by directly changing the Document Object Model (DOM), allowing content updates, style changes, and animations in real-time without reloading the page. This capability enables developers to provide interactive elements, responsive designs, and seamless page transitions, improving user engagement and the overall web experience .

JavaScript enhances user interactivity on web pages by facilitating real-time user interaction. It modifies HTML elements dynamically, responds to user actions, validates forms, and interacts with servers to update content without requiring full page reloads, thus providing a seamless and interactive user experience .

JavaScript is unique due to its full integration with HTML/CSS, simplicity in performing complex tasks, and broad support across all major web browsers with default enablement. These features contribute to its widespread adoption as it allows developers to create dynamic and interactive web content efficiently and consistently across different platforms .

The <script> tag in HTML embeds client-side scripts or links to external JavaScript files, facilitating dynamic content, form validation, and style manipulation. The attributes 'async' and 'defer' control script execution timing: 'async' executes scripts asynchronously, meaning they will run immediately as they are downloaded, while 'defer' ensures scripts run only after the HTML has been fully parsed, optimizing page load times and interactions .

JavaScript was created in 1995 by Brendan Eich, initially named 'Mocha'. It was later renamed 'LiveScript' before becoming 'JavaScript'. These name changes reflected its evolving role in web development, shifting from a proprietary language for Netscape to a widely used scripting language standardized by ECMA. This evolution shows the strategic rebranding and its alignment with Java's popularity at the time to enhance marketability .

JavaScript can manipulate HTML elements, interact with users and servers, create new elements, delete existing ones, modify elements, react to user actions, and access browser cookies and local storage. However, it cannot read/write files on the hard disk, copy or execute programs, or access OS functions directly. It is also restricted from accessing other pages if they originate from different domains, protocols, or ports .

JavaScript's cross-site restrictions, which prevent access to scripts on different domains, protocols, or ports, ensure security but can limit functionality by restricting direct cross-domain interactions. To overcome these, techniques such as Cross-Origin Resource Sharing (CORS) and JSONP are used in modern web applications to safely enable controlled data sharing while maintaining security standards .

JavaScript's restrictions on accessing files and OS functions significantly enhance web security. These limitations prevent malicious scripts from reading/writing to the client’s file system or executing OS-level functions, thus reducing the risk of security vulnerabilities and protecting user data and privacy on client machines .

The lack of initial standardization in JavaScript led to syntax and feature inconsistencies, hindering the development of cross-platform applications. Developers faced compatibility issues, requiring them to write browser-specific code. This fragmentation slowed community adoption until ECMA standardized JavaScript, which unified the language across different environments, improving reliability, enhancing developer productivity, and increasing widespread adoption .

You might also like