delivered by: shubham shrivastava

18
Delivered By: Shubham Shrivastava. Advisor : Department Of CSE/IT (SOP). Web Designing

Upload: joan-maldonado

Post on 01-Jan-2016

34 views

Category:

Documents


1 download

DESCRIPTION

Web Designing. Advisor : Department Of CSE/IT (SOP). Delivered By: Shubham Shrivastava. Introduction. 1. Basics syntax. 2. Events. 3. Form Validation. 4. Javascript. JavaScript was designed to add interactivity to HTML pages JavaScript is a scripting language - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Delivered By: Shubham Shrivastava

Delivered By:

Shubham Shrivastava.

Advisor :Department Of

CSE/IT (SOP).

Web Designing

Page 2: Delivered By: Shubham Shrivastava

Introduction1

Basics syntax2

Events3

Form Validation4

JAVASCRIPT

Page 3: Delivered By: Shubham Shrivastava

INTRODUCTION

JavaScript was designed to add interactivity to HTML pages

JavaScript is a scripting language A scripting language is a lightweight programming

language. JavaScript is usually embedded directly into HTML

pages. JavaScript is an interpreted language (means that

scripts execute without preliminary compilation). Everyone can use JavaScript without purchasing a

license.

Page 4: Delivered By: Shubham Shrivastava

WHAT CAN A JAVASCRIPT DO?

JavaScript gives HTML designers a programming tool

JavaScript can put dynamic text into an HTML page.

JavaScript can read and write HTML elements - A JavaScript can read and change the content of an HTML element

Page 5: Delivered By: Shubham Shrivastava

USING JAVASCRIPT IN HTML PAGES

<html><body>

<h1>My First Web Page</h1>

<script type="text/javascript">document.write("<p>" + Date() + "</p>");</script>

</body></html>

Page 6: Delivered By: Shubham Shrivastava

USING AN EXTERNAL JAVASCRIPT

<html><head><script type="text/javascript" src="xxx.js"></script></head><body></body></html>

Page 7: Delivered By: Shubham Shrivastava

JavaScript can also be placed in external files.

External JavaScript files often contains code to be used on several different web pages.

External JavaScript files have the file extension .js

Page 8: Delivered By: Shubham Shrivastava

AN EXAMPLE USING DIFFERENT SCRIPTS IN PAGE

<html><body><p>paragraph 1</p><script type="text/javascript">document.bgColor="blue";alert("first script block");

</script><p>paragraph 2</p><script type="text/javascript">document.bgColor="red";alert("second script block");

Page 9: Delivered By: Shubham Shrivastava

</script><p>paragraph 3</p><script type="text/javascript">document.bgColor="green";alert("third script block");

</script></body></html>A html page

Page 10: Delivered By: Shubham Shrivastava

THERE ARE VARIOUS INBUILD FUNCTIONS UED IN JAVASCRIPT

Document.write:For printing some text on the page. All html tags can also be used in this case.

Document.bgColor:which changes the color of the page.

Alert:which display a message box. Prompt:which ask the user to input some

value. Confirm:it ask the user for confirming the

values input.

Page 11: Delivered By: Shubham Shrivastava

TYPES OF DATA IN JAVASCRIPT

Numeric data Text data Boolean data

Page 12: Delivered By: Shubham Shrivastava

VARIABLES IN JAVASCRIPT

A variable can have a short name, like x, or a more descriptive name, like carname.

Rules for JavaScript variable names: Variable names are case sensitive (y

and Y are two different variables) Variable names must begin with a

letter or the underscore character

Page 13: Delivered By: Shubham Shrivastava

OPERATORS IN JAVASCRIPT

+ Addition - Subtraction * Multiplication / Division % Modulus ++ Increment -- Decrement

Page 14: Delivered By: Shubham Shrivastava

<html><head><script type="text/javascript"

src="jjj.js"></script></head><body><p>here is the javascript used</p></body></html>

Page 15: Delivered By: Shubham Shrivastava

EXTERNAL JAVASCRIPT

var a=prompt("enter the temperature in degree farenheit");

var b;b=5/9*(a-32)alert(b);document.write(b);

Page 16: Delivered By: Shubham Shrivastava

16

EVENTS IN JAVASCRIPT FORM

onSubmit(); onChange(); onBlur(); onSelect();

Page 17: Delivered By: Shubham Shrivastava

17

FORM VALIDATION

We can validate our form by keeping this objective: That any textbox not left blank When user submit the form the alert box

shows your message is recorded.

Page 18: Delivered By: Shubham Shrivastava

18

WE HAVE DONE WITH JAVASCRIPT

Thank You