It is lightweight and most commonly used as a part of web pages, whose implementations allow client-side script to interact with the user
and make dynamic pages.
JavaScript
JavaScript
Why to Learn Javascript?
What is the output of this?
<html>
<body>
<script>
document.write("Hello World!")
</script>Hello World!
Enumerate the applications of JavaScript Programming
the most common form of the language.
The script should be included in or referenced by an HTML document for the code to be interpreted by the browser.
Client-side JavaScript
True or False
The JavaScript code is executed when the user submits the form, and only if all the entries are valid, they would be submitted to the Web Server.
True
True or False
JavaScript can be used to trap user-initiated events such as button clicks, link navigation, and other actions that the user initiates explicitly or implicitly.
True
Enumerate the Advantages of JavaScript
You can validate user input before sending the page off to the server.
Less server interaction
They don’t have to wait for a page reload to see if they have forgotten to enter something.
Immediate feedback to the visitors
You can create interfaces that react when the user hovers over them with a mouse or activates them via the keyboard.
Increased interactivity
You can use JavaScript to include such items as drag-and-drop components and sliders to give a Rich Interface to your site visitors.
Richer interfaces
What are the limitations of JavaScript
-Client-side JavaScript does not allow the reading or writing of files. This has been kept for security reason
-JavaScript cannot be used for networking applications because there is no such support available.
-JavaScript doesn’t have any multi-threading or multiprocessor capabilities.
True or False
...HTML tags in a web page.
True
True or False
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 <head> tags.
True
Enumerate the two important attributes in script tags
-Language
- Type
This attribute specifies what scripting language you are using. Typically, its value will be JavaScript.
Language
This attribute is what is now recommended to indicate the scripting language in use and its value should be set to “text/javascript”.
Type
JavaScript ignores spaces, tabs, and newlines that appear in JavaScript programs.
Whitespace and Line Breaks
Simple statements in JavaScript are generally followed by a semicolon character, just as they are in C, C++, and Java.
Semicolons are Optional
JavaScript is a _______________ language. This means that the language keywords, variables, function names, and any other identifiers must always be typed with a consistent capitalization of letters.
case-sensitive / case sensitivity
What is the comment in JavaScript?
// and /* */
What is the external file from HTML to JavaScript?