JavaScript can be used for client-side scripting to add interactivity to web pages. The client-side environment where JavaScript runs is usually a web browser. JavaScript code is transferred from the web server to the user's computer and run directly in the browser. Common uses of JavaScript include adding multimedia elements to pages, creating pages dynamically based on user input, and allowing interaction through events like clicking buttons.
ACT Academy provides training in web designing , Graphic Designing, CAD Designing, .NET, JAVA, PHP. We also have advance diploma courses in Web Designing, CAD Designing, Financial Accounting & Graphic Designing with 100% job assurance.
Over 200 Pages of resources and code snippets to learn JavaScript and JavaScript DOM manipulation. JavaScript is the most popular web programming language and this eBook will help you learn more about JavaScript Coding
ACT Academy provides training in web designing , Graphic Designing, CAD Designing, .NET, JAVA, PHP. We also have advance diploma courses in Web Designing, CAD Designing, Financial Accounting & Graphic Designing with 100% job assurance.
Over 200 Pages of resources and code snippets to learn JavaScript and JavaScript DOM manipulation. JavaScript is the most popular web programming language and this eBook will help you learn more about JavaScript Coding
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
This presentation provides a briefing on how to upload submissions and documents in Google Classroom. It was prepared as part of an orientation for new Sainik School in-service teacher trainees. As a training officer, my goal is to ensure that you are comfortable and proficient with this essential tool for managing assignments and fostering student engagement.
How to Create Map Views in the Odoo 17 ERPCeline George
The map views are useful for providing a geographical representation of data. They allow users to visualize and analyze the data in a more intuitive manner.
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
Unit 8 - Information and Communication Technology (Paper I).pdfThiyagu K
This slides describes the basic concepts of ICT, basics of Email, Emerging Technology and Digital Initiatives in Education. This presentations aligns with the UGC Paper I syllabus.
How to Split Bills in the Odoo 17 POS ModuleCeline George
Bills have a main role in point of sale procedure. It will help to track sales, handling payments and giving receipts to customers. Bill splitting also has an important role in POS. For example, If some friends come together for dinner and if they want to divide the bill then it is possible by POS bill splitting. This slide will show how to split bills in odoo 17 POS.
Palestine last event orientationfvgnh .pptxRaedMohamed3
An EFL lesson about the current events in Palestine. It is intended to be for intermediate students who wish to increase their listening skills through a short lesson in power point.
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
Ethnobotany and Ethnopharmacology:
Ethnobotany in herbal drug evaluation,
Impact of Ethnobotany in traditional medicine,
New development in herbals,
Bio-prospecting tools for drug discovery,
Role of Ethnopharmacology in drug evaluation,
Reverse Pharmacology.
2. Client-side EnvironmentThe client-side environment
used to run scripts is usually
a browser. The processing takes
place on the end users computer.
The source code is transferred
from the web server to the
u s e r s c o m p u t e r o v e r t h e
internet and run directly in
the browser.
The scripting language needs to
b e e n a b l e d o n t h e c l i e n t
computer. Sometimes if a user
is conscious of security risks
they may switch the scripting
facility off. When this is the
3. Client-side EnvironmentThis party requests pages from
the Server, and displays them
to the user. In most cases, the
client is a web browser.
The User opens his web browser (the Client).
The User browses to http://google.com.
The Client (on the behalf of the User), sends a request
to http://google.com (the Server), for their home page.
The Server then acknowledges the request, and replies
the client with some meta-data (called headers),
followed by the page's source.
The Client then receives the page's source, and renders
it into a human viewable website.
The User types Stack Overflow into the search bar,
and presses Enter
The Client submits that data to the Server.
The Server processes that data, and replies with a
page matching the search results.
The Client, once again, renders that page for the
User to view.
4. Client-side EnvironmentThe User types Stack Overflow into the search bar, and
presses Enter
The Client submits that data to the Server.
The Server processes that data, and replies with a page
matching the search results.
The Client, once again, renders that page for the User
to view.
Example languages
JavaScript (primarily), HTML*, CSS*
Any language running on a client device that
interacts with a remote service is a
client-side language.
5. Server-side EnvironmentServer-side programming, is the
general name for the kinds of
programs which are run on the
Server.
This is different from client-
side scripting where scripts
are run by the viewing web
browser, usually in JavaScript.
T h e p r i m a r y a d v a n t a g e t o
server-side scripting is the
ability to highly customize the
response based on the user's
requirements, access rights, or
queries into data stores.
Example Languages
7. JavaScriptJavaScript was released by
Netscape and Sun Microsystems
in 1995. However, JavaScript
is not the same thing as Java.
JavaScript is a cross-platform,
object-oriented scripting
language, programming language,
interpreted language, object-
based programming, small and
lightweight language.
8. Use of JavaScript?Use it to add multimedia
elements
With JavaScript you can show,
hide, change, resize images,
and create image rollovers.
You can create scrolling text
across the status bar.
Create pages dynamically
Based on the user's choices,
the date, or other external
data, JavaScript can produce
pages that are customized to
the user.
Interact with the user
It can do some processing of
9. Why Study JavaScript?JavaScript is one of the 3
languages all web developers
must learn:
1. HTML to define the content
of web pages
2. CSS to specify the layout of
web pages
3. JavaScript to program the
behavior of web pages
10. Writing JavaScriptJavaScript code is typically
embedded in the HTML, to be
interpreted and run by the
client's browser. Here are some
tips to remember when writing
JavaScript commands
• JavaScript code is case sensitive.
• White space between words and tabs are
ignored•
• Line breaks are ignored except within a
statement•
• JavaScript statements end with a semi- colon ;
11. The SCRIPT TagThe <SCRIPT> tag alerts a
browser that JavaScript code
follows. It is typically
embedded in the HTML.
<SCRIPT language =
"JavaScript">
statements
</SCRIPT>
Example :
1. <SCRIPT language =
"JavaScript">
alert("Welcome to the script
tag test page.")
</SCRIPT>
2. <script type="text/javascript"
12. Syntatic Characteristics1.Identifiers
1. Identifier must be begin with either letter or
underscore or dollor sign.
2. No limit of length.
3. Variable Name must not hava uppercase letter
2.Reserved Word
1. break, continue, delete, for, in, return, var, default,
else, function
3.Comments
1.// : Single Line Comment
2./* and */ : Multi Line
Comment
3.The XHTML <!-> and <-> is
alos allowed in javascript.
14. To declare variables, use the
keyword var and the variable
name:
var userName
To assign values to variables,
add an equal sign and the value:
var userName = "Smith"
var price = 100
23. IF Statementif statement
if...else statement
if...else if... statement.
<script type="text/javascript">
var age = 20;
if( age > 18 ){
document.write("<b>Qualifies for driving</b>");
}
</script>
24. if...else statement:
Syntex:
if (expression) {
Statement(s) to be executed
if expression is true
}
else {
Statement(s) to be executed
if expression is false
}
The 'if...else' statement is the next form of control statement that allows JavaScript to execute
statements in a more controlled way.
<script type="text/javascript">
var age = 15;
if( age > 18 ){
document.write("<b>Qualifies for driving</b>");
}
else{
document.write("<b>Does not qualify for driving</b>");
}
</script>
26. While Loop
while (expression){
Statement(s) to be executed if expression is true
}
<script type="text/javascript">
<!--
var count = 0;
document.write("Starting Loop ");
while (count < 10){
document.write("Current Count : " + count + "<br />");
count++;
}
document.write("Loop stopped!");
//-->
</script> Output :
Starting Loop
Current Count : 0
Current Count : 1
Current Count : 2
27. do While Loop
<script type="text/javascript">
<!--
var count = 0;
document.write("Starting Loop" + "<br />");
do{
document.write("Current Count : " + count + "<br />");
count++;
}
while (count < 5);
document.write ("Loop stopped!");
//-->
</script>
Output
Starting Loop
Current Count : 0
Current Count : 1
Current Count : 2
28. For Loop
for (initialization; test condition; iteration statement)
{
Statement(s) to be executed if test condition is true
}
<script type="text/javascript">
<!--
var count;
document.write("Starting Loop" + "<br />");
for(count = 0; count < 10; count++){
document.write("Current Count : " + count );
document.write("<br />");
}
document.write("Loop stopped!");
//-->
</script>
29. For ...IN Loop
The for...in loop is used to loop through an object's properties.
for (variablename in object){
statement or block to execute
}
<script type="text/javascript">
var aProperty;
document.write("Navigator Object Properties<br /> ");
for (aProperty in navigator) {
document.write(aProperty);
document.write("<br />");
}
document.write ("Exiting from the loop!");
</script>
30. Function
A function is a group of reusable code which can be called anywhere in your program. This
eliminates the need of writing the same code again and again. It helps programmers in writing
modular codes.
<script type="text/javascript">
<!--
function functionname(parameter-list)
{
statements
}
//-->
</script>
<script type="text/javascript">
<!--
function sayHello()
{
alert("Hello there");
}
//-->
</script>
31. Function
<html>
<head>
<script type="text/javascript">
function sayHello() {
document.write ("Hello there!"); }
</script>
</head>
<body>
<p>Click the following button to call the function</p>
<form>
<input type="button" onclick="sayHello()" value="Say Hello">
</form>
<p>Use different text in write method and then try...</p>
</body>
</html>
Hello there!
32. Event
JavaScript's interaction with HTML is handled
through events that occur when the user or the
browser manipulates a page.
When the page loads, it is called an event. When
the user clicks a button, that click to is an
event. Other examples include events like pressing
any key, closing a window, resizing a window, etc.
Developers can use these events to execute
JavaScript coded responses, which cause buttons to
close windows, messages to be displayed to users,
data to be validated, and virtually any other type
of response imaginable.
35. Array
The Array object lets you store multiple values in a single variable.
It stores a fixed-size sequential collection of elements of the same type.
var fruits = new Array( "apple", "orange", "mango" );
You can create array by simply assigning values as follows −
var fruits = [ "apple", "orange", "mango" ];
37. Two-Dimensional Array
var iMax = 20;
var jMax = 10;
var f = new Array();
for (i=0;i<iMax;i++) {
f[i]=new Array();
for (j=0;j<jMax;j++) {
f[i][j]=0;
}
}
38. Pop up Boxes
JavaScript has three kind of popup boxes:
1. Alert box.
2. Confirm box.
3. Prompt box.
42. Object
JavaAScript is an Object Oriented Programming (OOP) language. A
programming language can be called object-oriented if it provides basic
capabilities to developers −
• Booleans can be objects (or primitive data treated as objects)
• Numbers can be objects (or primitive data treated as objects)
• Strings can be objects (or primitive data treated as objects)
• Dates are always objects
• Maths are always objects
• Regular expressions are always objects
• Arrays are always objects
• Functions are always objects
• Objects are objects
43. Creating Object
<!DOCTYPE html>
<html>
<body>
<p>Creating a JavaScript Object.</p>
<p id="demo"></p>
<script>
var person = {firstName:"John", lastName:"Doe", age:50,
eyeColor:"blue"};
document.getElementById("demo").innerHTML =
person.firstName + " is " + person.age + " years old.";
</script>
</body>
</html>
Creating a JavaScript Object.
John is 50 years old.
56. Boolean Object
The Boolean object represents two values, either "true" or "false". If value
parameter is omitted or is 0, -0, null, false, NaN, undefined, or the empty
string (""), the object has an initial value of false.
59. String Object
The String object lets you work with a series of characters; it
wraps Javascript's string primitive data type with a number
of helper methods.
var val = new String(string);
62. Document Object Model
The DOM is a W3C (World Wide Web Consortium) standard.
A Document object represents the HTML document that is displayed in
that window. The Document object has various properties that refer to
other objects which allow access to and modification of document
content.
The way a document content is accessed and modified is called the
Document Object Model, or DOM. The Objects are organized in a
hierarchy. This hierarchical structure applies to the organization of objects
in a Web document.
The W3C DOM standard is separated into 3 different parts:
Core DOM - standard model for all document types
XML DOM - standard model for XML documents
HTML DOM - standard model for HTML documents
63. Document Object Model
• Window object − Top of the hierarchy. It is the outmost
element of the object hierarchy.
• Document object − Each HTML document that gets
loaded into a window becomes a document object. The
document contains the contents of the page.
• Form object − Everything enclosed in the
<form>...</form> tags sets the form object.
• Form control elements − The form object contains all
the elements defined for that object such as text fields,
buttons, radio buttons, and checkbox.
65. The DOM Programming Interface
The HTML DOM can be accessed with JavaScript (and with other
programming languages).
In the DOM, all HTML elements are defined as objects.
The programming interface is the properties and methods of each
object.
A property is a value that you can get or set (like changing the content
of an HTML element).
A method is an action you can do (like add or deleting an HTML
element).
69. Validation
Form validation normally used to occur at the server, after
the client had entered all the necessary data and then
pressed the Submit button.
If the data entered by a client was incorrect or was simply
missing, the server would have to send all the data back to
the client and request that the form be resubmitted with
correct information.
70. Validation
Form validation generally performs two functions.
Basic Validation − First of all, the form must be
checked to make sure all the mandatory fields are
filled in. It would require just a loop through each
field in the form and check for data.
Data Format Validation − Secondly, the data that
is entered must be checked for correct form and
value. Your code must include appropriate logic to
test correctness of data.