php and scripting language, Study notes of Javascript programming

use the document to very use full

Typology: Study notes

2019/2020

Uploaded on 10/27/2020

gaming-world-gangsters
gaming-world-gangsters 🇮🇳

1 document

1 / 233

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Partial preview of the text

Download php and scripting language and more Study notes Javascript programming in PDF only on Docsity!

Starting No. Ending No. JavaScript 1 47 47 1 40 40 VBScript 48 84 37 41 80 40

II

VBScript 85 101 17 81 91 11

III

JavaScript 102 122 21 92 104 13

IV PHP

123 155 33 105 150 46

V

PHP 156 214 59 151 203 53 215 229 15 204 207 4

General

Topics

Total Number of Pages Example Programs Total Numberof Programs Index Page (PHP)

I

Units Particulars Starting Page^ Ending Page

Unit-I

JAVA SCRIPT

Java Script was released by Netscape and Sun Micro system in the year 1995, Java script is not similar like java.

DEFINE JAVA SCRIPT

  • JavaScript life as Live Script but Netscape changed the name, possibly because as the Excitement being generate by Java to Java Script.
  • Java Script made its first appearance in Netscape version 2.0 1995 with a name Live script.
  • Java Script is a lightweight, interpreted Programming Language and designed for creative network- satiric applications for complementary and integrated such as Java HTML.
  • Open and Cross platform, it’s widely used for supported. It is accessible due to beginner.

USE OF JAVA SCRIPT It used to add multimedia elements

CLIENT-SIDE

Client-side JavaScript is the most common form of the language. The script should be included in HTML document for code to be interpreted by the browser. Web pages need not be a static HTML, it can include programs interact with the user, control the browser, and dynamically create HTML content. 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. 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.

ADVANTAGES OF JAVASCRIPT

  • Less server interaction can validate user input before sending the page off to the server. This saves server traffic, which means fewer loads on your server.
  • Immediate feedback to the visitors they don't have to wait for a page reload to see if they have forgotten to enter something.

Macromedia Dreamweaver MX

Dreamweaver was created by Macromedia in 1997 , and was maintained by them until Macromedia

was acquired by Adobe Systems in 2005. Macromedia Dreamweaver MX is an easy, powerful, and

open authoring tool that every

member of the development

team can use to quickly build

robust websites and Internet

applications. Macromedia

Dreamweaver MX is a very

popular HTML and JavaScript

editor in the professional web

development crowd. It provides

several handy prebuilt JavaScript

components, integrates well

with databases, and conforms to

new standards.

Features

Dreamweaver is a web design and development application that combines a visual design surface known as Live View and a code editor with standard features such as syntax highlighting , code completion , and code collapsing. Combined with an array of site management tools, Dreamweaver lets its users design , code and manage websites as well as mobile content. Dreamweaver supports syntax highlighting for the following languages Action Script, Active Server Pages (ASP), C#, Cascading Style Sheets (CSS), ColdFusion, Extensible Hypertext Markup Language (XHTML), Extensible Markup Language (XML), Extensible Style sheet Language Transformations (XSLT), Hypertext Markup Language (HTML), JavaScript, PHP, Visual Basic Script Edition (VBScript) and Wireless Markup Language (WML).

Macromedia HomeSite 5

HomeSite was an HTML editor originally developed by Allaire

Corporation. Unlike WYSIWYG (what you see is what you get), HomeSite were designed for direct

editing, or "hand coding ," of HTML and JavaScript other website languages. After a successful

partnership with the company to

distribute it alongside its own

competing Dreamweaver

software, HomeSite was acquired

by Macromedia in 2001 , after

which elements of the software

were integrated into

Dreamweaver. Following the

acquisition of Macromedia by

Adobe Systems, the company

announced on May 26, 2009 that

HomeSite would be discontinued.

Features

a. Extensively script-able to automate tasks or to perform advanced tasks using JavaScript or VBScript.

b. Macro recorder can record a series of actions to create scripts for later playback

c. Enhanced code snippets save time by creating and saving reusable blocks of code , and can prompt for

variable replacement when used.

d. Customizable syntax color-coding for ASP, CFML, CSS, HTML, Java, JavaScript, JSP, Perl, PHP, SQL,

VBScript, VTML and XHTML. Syntax-coloring parser syntax and examples are available to help users.

e. Search and replace utility

f. CSS editing via the included Top Style Lite, or via integration with the full version of Top Style, if available,

check your code with the built-in Code Validator , or use CSE HTML Validator with UI integration.

g. Integrated help browser shows installed help docs or HTML-format document sets added by the user. Useful for

local, searchable copies of standards, tutorials, language references , etc.

h. Project management and built- in FTP help manage and upload websites

i. Built-in tools for page link-checking, document weight and spell-checking

j. XHTML 1.0 Support

Ver Official Name Description 1 ECMAScript 1 (1997) First Edition. 2 ECMAScript 2 (1998) Editorial changes only. 3 ECMAScript 3 (1999) Added Regular Expressions. , Added try/catch. 4 ECMAScript 4 Never released. 5 ECMAScript 5 (2009) Added "strict mode". Added JSON support. Added String.trim(). Added Array.isArray().Added Array Iteration Methods. 5.1 ECMAScript 5.1 (2011) Editorial changes. 6 ECMAScript 2015 Added let and const. Added default parameter values. Added Array.find(). Added Array.findIndex(). 7 ECMAScript 2016 Added exponential operator (**).Added Array.prototype.includes. 8 ECMAScript 2017 Added string padding. Added new Object properties. Added Async functions. Added Shared Memory. 9 ECMAScript 2018 Added rest / spread properties. Added Asynchronous iteration. Added Promise.finally(). Additions to RegExp.

What is different between “= = “and “= = =”.

While “= =” checks only for equality, “= = =” checks for equality as well as the type.

WRITING JAVA SCRIPT

Java script code is difficulty embedded in the HTML, to be interpreted and run by the client browser. ❖ Java script is case-sensitive. ❖ White space between words and tabs are ignoring. ❖ Line breaks are ignored except within a statement. ❖ Java script statements end with semi-colon (;).

JAVA VS JAVA SCRIPT

JAVA JAVA SCRIPT

Java invented by James Gosling and Sun Microsystems Java Script invented by Brendan Eich. Java Powered by Sun Micro System, Open JDK, many others Java Script powered by Netscape Navigator Java released in 1995 Java Script released in 1995 Java score must have parsed, compiled (not interpreter) into object code can be run any platform (operating system & not necessary a browser) having the JRE. Java Script codes are interpreter language Java creates an application that runs java virtual machine or browser. (^) Java programs runs in only Web-browser Java is an OOPS programming language. Java script is an OOPS script language. Java program code executed by compiled to byte code Java Script Codes are all in text, does not need to be compiled Java programs statement terminated by Semicolon(;) Java Script programs also same Java codes needs to be complied Java Script code all in text they require different plug-in.

THE SCRIPT TAG:

  • JavaScript can be implemented using JavaScript statements that are placed within the **** HTML tags in a web page. You can place the ** (or)

** (or)

The script tag takes are important attributes:

  • Language − This attribute specifies what scripting language you are using. Typically, its value will be JavaScript. Although recent versions of HTML (and XHTML, its successor) have phased out the use of this attribute.
  • Type − This attribute is what is now recommended to indicate the scripting language in use and its value should be set to "text/JavaScript".
  • src − The location of an external scripting file

Example – 01

** Java Script Program

This is My First JavaScript Program**

Example – 04

** Arithmetic **

CHANGE THE BG COLOR AND FORE COLOR:

MeSSAGE BOX (OR) POPUP MESSAGE BOX :

There are 3 message boxes: 1) alert 2) confirm 3) prompt Alert: **** Confirm: **** Prompt: ****

WHITE SPACES AND LINE BREAKS:

Java Script ignores spaces, tabs and new lines that appear in java script programs. Because you can use spaces, tabs and new line freely in your program so you are free to format and indent your programs in a neat and consistent use that makes the code easy to read and understand. Enter the First No. : 20 Enter the Second No.: 10 Sum = 30 Subtract = 10 Multiply = 200 Division = 2

SEMI-COLON (;) OR OPTIONAL:

  • Simple statements in java script are generally followed by a semi-colon(;) character
  • Java script, however allows you to omit this semi-colon(;) if your statement are each placed on a separate line. ** Sorry...JavaScript is needed to go ahead.

Script Enabled**

JAVASCRIPT IN AND SECTIONS

Example - 08

**

**

JAVASCRIPT IN EXTERNAL FILE

This is advantageous to group common functions in an external JavaScript file. This permits the reuse of the functions in the file in multiple HTML pages. JavaScript functions are stored in a file using the .js extension. Here is an example to show how you can include an external JavaScript file in your HTML code using script tag and its src attribute.

Example – 09 // functions.js

function multiply(num1, num2) { return num1*num2; } //Index1.html

JavaScript Example

Hello World Hello World 12

JAVASCRIPT – VARIABLES

One of the most fundamental characteristics of a programming language is the set of data types it

supports. These are the type of values that can be represented and manipulated in a programming

language. Before you use a variable in a JavaScript program, you must declare it. Variables are

declared with the var keyword,

Identifiers

All JavaScript variables must be identified with unique names.

These unique names are called identifiers.

Identifiers can be short names (like x and y) or more descriptive names (age, sum, totalVolume).

The general rules for constructing names for variables (unique identifiers) are:

  • Names can contain letters, digits, underscores, and dollar signs.
  • Names must begin with a letter
  • Names can also begin with $ and _ (but we will not use it in this tutorial)
  • Names are case sensitive (y and Y are different variables)
  • Reserved words (like JavaScript keywords) cannot be used as names

Storing a value in a variable is called variable initialization. You can do variable initialization at the time of variable creation or at a later point in time when you need that variable.

JAVASCRIPT DATA TYPES

One of the most fundamental characteristics of a programming language is the set of data types it supports. These are the type of values that can be represented and manipulated in a programming language. JavaScript allows you to work with three primitive data types −

  • Numbers, e.g.123, 120.50 etc.
  • Strings of text e.g. "This text string" etc.
  • Boolean e.g. true or false. JavaScript also defines two trivial (small) data types, null and undefined, each of which defines only a single value. In addition to these primitive data types, JavaScript supports a composite data type known as object.

abstract

boolean

break

byte

case

catch

char

class

const

continue

debugger

default

delete

do

double

else

enum

export

extends

false

final

finally

float

for

function

goto

if

implements

import

in

instanceof

int

interface

long

native

new

null

package

private

protected

public

return

short

static

super

switch

synchronized

this

throw

throws

transient

true

try

typeof

var

void

volatile

while

with

JAVASCRIPT - OPERATORS

WHAT IS AN OPERATOR?

Let us take a simple expression 4 + 5 is equal to 9. Here 4 and 5 are called operands and ‘+’ is called the operator. JavaScript supports the following types of operators.

**1. Arithmetic Operators

  1. Comparison Operators
  2. Logical (or Relational) Operators** ✓ Bitwise Operator **4. Assignment Operators
  3. Miscellaneous Operators** ✓ Conditional (or Ternary) Operators ✓ Typeof operator

1. ARITHMETIC OPERATORS: Assume A=10, B=

Operator Description Example + Adds two operands. A+B=

- Subtract second operand from the first. B-A= ***** Multiply the both operands. A*B= / Divide numerator by divider. B/A= % Module Operator. B%A= ++ Increment Operator. Increase integer value by one. A++= -- Decrement Operator. Decrease integer value by one. A--=

Example - 11

**

Arithmetic Operator Program Output** a + b = 43 a - b = 23 a / b = 3. a % b = 3 a * b = 330 Test ++a = 35 --b = 8