Documente Academic
Documente Profesional
Documente Cultură
– It is a high configuration computer on Internet that stores web sites and serves web pages to
clients on request.
2.Web Browser – It is a software program used to browse web pages. E.g Chrome, IE, Opera,
Netscape navigator, Mozilla Firefox
4.Homepage – The first web page that is displayed when you visit a website.
FRAMES-
-It is used to divide the browser window into several parts through which we can see more than one
web page at a time.
<frameset>
<frame>
E.g.
<HTML>
<HEAD>
<TITLE>frame example</TITLE>
</HEAD>
<frameset rows="25%,50%,25%">
<frame src="web1.htm">
<frame src="web2.htm">
<frame src="web3.htm">
</frameset>
</HTML>
- The rows/cols values indicate the amount of screen area, each row/column will occupy
Values of area can be given in % or pixels or by relative value using * (asterisk) symbol.
Attributes of <frame>-
Name – assigns a name to the frame.
Frameborder - specifies the border around frame. By default value is 1. 0 value for no border.
Noresize - This attribute prevents the user from resizing the frame.
Scrolling – specifies whether to display scrollbar. It can have one of the three values - YES, NO,
AUTO.
<noframes> tag-
The <noframes> tag is a fallback tag for browsers that do not support frames. It can contain all the
HTML elements that you can find inside the <body> element of a normal HTML page.
The <noframes> element can be used to link to a non-frameset version of the web site or to display
a message to users that frames are required.
Example:
<html>
<head>
</head>
<body>
<noframes>
</noframes>
</frameset>
</body>
</html>
<iframe> tag -
-An inline frame is a frame that is displayed in a box within a web page.
-<iframe> tag is used to create inline frame. The inline frame can display images or web pages
within it.
Attributes :
Attribute Value Description
src URL Specifies the address of the document to embed in the <iframe>
longdesc URL Specifies a page that contains a long description of the content of an <
marginheight pixels Specifies the top and bottom margins of the content of an <iframe>
marginwidth pixels Specifies the left and right margins of the content of an <iframe>
scrolling Yes /no /auto Specifies whether or not to display scrollbars in an <iframe>
1. rect - for defining rectangle area, upper left and right bottom (X,Y)
coordinates.
2. circle - for defining circle area, coordinates of center point and radius is
specified.
3. poly - for defining polygon area, 3 or more pair of coordinated to form
polygon
<html>
<body>
<img src="images/globe.jpg" usemap="#test">
<map name="test">
<area shape="rect" coords="22,37,123,97" href="page1.html">
<area shape="circle" coords="406,38,30" href="page2.html">
<area shape="poly" coords="48,169,142,234,50,248" href="page3.html">
</map>
</body>
</html>
The coordinates for the shape are found by opening the globe.jpg
picture in Paint by placing the arrow over the points and note down the
coordinates.
In Server side mapping, the image map is mentioned by using ISMAP attribute
in the <img> tag.
The map details are save in a text file with the extension .map and place this file
in the same folder in which html document containing the image is placed.
E.g. Server side image mapping - the map is written in globe.map file
which is placed on server
globe.map
Default http://exza.in/xyz.html
Rect http://exza.in/page1.html 22,37,123,97
Circle http://exza.in/page2.html 286, 90, 45
Poly http://exza.in/page3.html 48,169,142,234,50,24
mapexample.html
<html>
<body>
<a href="http://exza,in/globe.map> <img src="images/globe.jpg" ISMAP> </a>
</body>
</html>
The href attribute of <a> tag specifies the location of external map file and
server side image map program on the web server. The <img> tag is reference
for the mapped file. The ISMAP attribute in the <img> tag specifies that the
image is mapped file. ISMAP indicates a server side image map.
FORMS
-Forms are used to accept or input the data from user. The form consists of objects called
form elements.
E.g. Text box, Password box, Radio button, List box, Command button, submit button, Drop
list box, Check box, etc.
-To create forms, <form> tag is used. All the elements are placed within <form> </form>
tags.
-<input> tag: Used to create the form fields.
-Password field
Used to type password (displays * or . )
E.g. <input type=password name="pwd">
-Submit button
Creates submit button, used to send form data to server for processing.
E.g. <input type=submit value="submit">
Radio button
It's a toggle button and only one option can be selected from a group of radio buttons.
E.g. <input type=radio name=gender value="M">
<input type=radio name=gender value="F">
Check box
Used to select one or more options from number of choices
E.g. <input type=checkbox name=hobby value="Cri">
<input type=checkbox name=hobby value="Bas">
Button field
It is used to display a command button to which we can assign a function (task).
Clicking the button will activate a function.
E.g. <input type=button name=button1 onclick="function();">
<textarea> tag
It is used to create multiline textbox or large editable area.
E.g.
<textarea rows=3 cols=40>
</textarea>
Attributes of <textarea> tag:
Name - assigns a name to the text area
Rows - specifies the height of the text area in number of lines.
Cols - specifies the width of the text area in no. of columns /characters.
Hidden field
The purpose of the hidden field is to store the value that need to be sent to server along with
form. The browser does not display these values.
E.g. <input type=hidden name=xyz value=256>
Attributes of <form> tag:
Method - It specifies the method of sending form data to the server.
There are two methods:
GET - It appends the data to the URL in name/value pairs.
POST - sends the form data hidden in HTTP headers not visible on the screen.
Action - It specifies the location/path or URL of the server where the form data is to be
submitted.
Name - assigns a name to the form.
E.g.
<form method=post name=form1 action="http://www.exza.in/getdata.php">
Inserting Sound and Video into Web page -
Popular Sound/Audio formats:
.WAV - developed by Microsoft and IBM. It is the standard format for Windows.
.AIFF - (Audio Interchange File Format) developed by Apple for MAC platform
.Ra - (Real Audio Format) is lower quality audio format (smaller in size)
.MP3 - MP3 (MPEG-1 Audio Layer-3) is a standard technology and format for compressing
a sound sequence into a very small file (about one-twelfth the size of the original file) while
preserving the original level of sound quality when it is played. MP3 provides near CD quality
audio.
Attributes:
Src - specify the name of audio file
Loop - specifies the number of times the file must be played.
E.g. loop="infinite" or loop=-1
loop=2
<embed> tag
It is used to insert audio as well as video both.
It provides console for controlling.
E.g. <embed src="music/quit.mp3" height=100
Width=200>
Attributes of <embed> tag:
Src - Specifies the name of audio or video file.
Autostart - specifies whether audio should start on page load. It has two values true or
false.
True value plays music when page is loaded.
False value will play music when user clicks play button.
Hidden - It is to hide the console. True value hides the console.
Volume - Sets the volume of music. Values from 1 to 100 can be set. Default is 50.
Width - specifies the width of the console.
Height - specifies the height of the console.
Controls - specifies console size Values - console or small consoles
Value console gives the complete console with play, stop and pause button.
Video formats
.AVI (Audio Video Interleave) - format developed by Microsoft for Windows platform.
.WMV (Windows Media video) - developed by Mircosoft
.QT (Quick Time) - format developed by Apple for MAC platform
.MPG / .MPEG / .MP4 - formats developed by Moving Picture experts group, popular
format on web.
.flv - developed by Adobe Flash (low quality)
By using Unicode and Indian language fonts Arial Unicode MS and Mangal
About Unicode:
Unicode is a computing industry standard for the consistent encoding,
representation, and handling of text expressed in most of the world's writing
systems.
It is a standard character set encoding developed and maintained by The
Unicode Consortium.
It can support over one million characters.
It supports all characters from all scripts, as well as many symbols.
Unicode also knows as UTF-8 (Unicode Transformation Format-8) or the
Universal Alphabet.
Today all the web browser and operating systems includes Unicode support.
Steps for language settings in Windows
1. Go to Control Panel
2. Click on Clock, Language and Regional.
5. In the "Text Services and Input Languages" window, in the General tab,
click on Add button.
6. In the Add Input Language window, Search for your required indian
language and click the plus sign to open.
7. Now click the plus sign to open Keyboard option and click on Devnagari In
script checkbox.
8. Click on the OK button.
9. Now in the Text Services and Input Languages, click the Default Input
Languages option and click on the selected language e.g. Marathi - Devnagari
Inscript option.
In every browser and platform the website will look and work differently.
Every web browser comes with variations and differences in the way a web
page is displayed and works.
Examples:
CSS SYNTAX
A CSS rule-set consists of a selector and a declaration block:
Example:
p{
color: red;
text-align: center;
}
h1 {
color: navy;
margin-left: 20px;
}
Note: Do not add a space between the property value and the unit (such as margin-
left:20 px;). The correct way is: margin-left:20px;
h1 {
color: maroon;
margin-left: 40px;
}
</style>
</head>
3. INLINE STYLES
An inline style may be used to apply a unique style for a single element.
To use inline styles, add the style attribute to the relevant element. The style attribute can
contain any CSS property.
The example below shows how to change the color and the left margin of a <h1> element:
Example:
<h1 style="color:blue;margin-left:30px;">This is a heading.</h1>
Note: If some properties have been defined for the same selector (element) in different style
sheets, the value from the last read style sheet will be used.
CSS SELECTORS
CSS selectors are used to "find" (or select) HTML elements based on their element name,
id, class, attribute, and more.
THE ELEMENT SELECTOR
The element selector selects elements based on the element name.
Example:
p{
text-align: center;
color: red;
}
THE ID SELECTOR
The id selector uses the id attribute of an HTML element to select a specific element.
The id of an element should be unique within a page, so the id selector is used to select one
unique element!
To select an element with a specific id, write a hash (#) character, followed by the id of the
element.
Example:
#para1 {
text-align: center;
color: red;
}
<p id="para1">
.....................................................
...................................................
</p>
THE CLASS SELECTOR
The class selector selects elements with a specific class attribute.
To select elements with a specific class, write a period (.) character, followed by the name
of the class.
Example:
.center {
text-align: center;
color: red;
}
GROUPING SELECTORS
If you have elements with the same style definitions, it will be better to group the selectors, to
minimize the code.
To group selectors, separate each selector with a comma.
Example:
h1, h2, p {
text-align: center;
color: red;
}
Lesson No. 1 Web Publishing Short Ques.
Answers
Lesson No. 1 Web Publishing
<frameset> tag
It is a container tag for defining frames.
It replaces the <body> tag in frameset documents
It defines how to divide the window into frames.
Each frameset defines a set of rows or columns.
To divide screen horizontally we use rows.
To divide screen vertically we use cols.
The rows/cols values indicate the amount of screen area, each row/column will
occupy
Attributes of frameset tag
i) Rows : It divides the screen into horizontal frames.
ii) Cols : It divides the screen into vertical frames.
Values of area can be given in % or pixels or by relative value using * (asterisk)
symbol.
<frame> tag
It is used to create frame within frameset. It defines what HTML document to put into
the frame.
Attributes of <frame>
Name : assigns a name to the frame.
Src : specifies the html page you want to display.
Frameborder : specifies the border around frame. By default value is 1. 0 value for
no border.
Marginwidth : sets left an right margins.
Marginheight : sets top and bottom margins.
Noresize : This attribute prevents the user from resizing the frame.
Scrolling : specifies whether to display scrollbar. It can have one of the three values :
YES, NO, AUTO.
<noframes> tag
The <noframes> tag is a fallback tag for browsers that do not support frames. It can
contain all the HTML elements that you can find inside the <body> element of a
normal HTML page.
The <noframes> element can be used to link to a non:frameset version of the web
site or to display a message to users that frames are required.
The <noframes> element goes inside the <frameset> element.
1) Client Side mapping : They are executed on client machine from web browser
itself. All information is loaded along with the image. It executes quickly. In Client
side mapping, the image map is mentioned by using USEMAP attribute in the
<img> tag. The map is specified in the <map> and <area> tags, which defines the
hotspot in an image. For specifying the areas of the hotspot, the <area> tag is used
within <map> tag.
2) Server side mapping : In this the program that executes the links is placed on
the server. The browser activates program on the server by sending x and y
coordinates of the position where hyperlink was created. On receiving the
coordinates the program on the server looks at the map file for close match and then
loads the file that is closet to coordinates. In Server side mapping, the image map is
mentioned by using ISMAP attribute in the <img> tag. The map details are save in a
text file with the extension .map and place this file in the same folder in which html
document containing the image is placed.
5. Explain forms and list the different tags used to construct web form.
A webform, web form or HTML form on a web page allows a user to enter data that
is sent to a server for processing. Forms can resemble paper or database forms
because web users fill out the forms using checkboxes, radio buttons, or text fields.
The HTML <form> element defines a form that is used to collect user input. An
HTML form contains form elements.
Form elements are different types of input elements, like text fields, checkboxes,
radio buttons, submit buttons, and more.
The list of different tags used to create form elements are:
2. Broken image - an image in a web page whose path is not found or path is wrong
or file name is given is wrong. Internet Explorer shows broken images with a red
color sign along with alternative text. In Netscape Navigator, it shows 3 color dots
with alternative text.
9. What is Unicode?
Unicode is a computing industry standard for the consistent encoding,
representation, and handling of text expressed in most of the world's writing systems.
It is a standard character set encoding developed and maintained by The Unicode
Consortium.
It can support over one million characters.
It supports all characters from all scripts, as well as many symbols.
Unicode also knows as UTF-8 (Unicode Transformation Format-8) or the Universal
Alphabet.
Today all the web browser and operating systems includes Unicode support.
h1 {
color: navy;
margin-left: 20px;
}
2) Internal style sheet
An internal style sheet may be used if one single page has a unique style.
Internal styles are defined within the <style> element, inside the <head> section of
an HTML page:
Example:
<head>
<style>
body { background-color: linen; }
h1 {
color: maroon;
margin-left: 40px;
}
</style>
</head>
3) Inline style
An inline style may be used to apply a unique style for a single element.
To use inline styles, add the style attribute to the relevant element. The style attribute
can contain any CSS property.
The example below shows how to change the color and the left margin of a <h1>
element:
Example:
<h1 style="color:blue;margin-left:30px;">This is a heading.</h1>
CGI programs are used to publish and process forms so that readers can submit
comments, order a product, or search for information from a web page.
Important applications of CGI are : Information display, User counting, Web Search Engines,
Indexing the content, CGI e-mail services, etc.
A Web server is a program running on a Computer that uses HTTP (Hypertext Transfer
Protocol) to serve the files that form Web pages to users, in response to their requests,
which are forwarded by their computers' HTTP clients (Web Browsers).
Web server is a computer that hosts websites and web pages i.e. where the web content is
stored.
A web server consists of a physical server, server operating system (OS) and software used
to facilitate HTTP communication like IIS, Apache, etc.
When you type a Web site address into your browser, Web servers are doing the work of
getting you the page you request.
8. List Do's and Don’ts for the ethics culture of Computer professionals.
Do’s:
Use the Internet to help the work required for knowledge base.
Use the Internet to communicate the messages.
Respect the privacy of other users on the Internet
Download legitimate and authentic programs from the Internet.
Use licensed software on your computer.
Don’ts:
Don’t try to break into computers of others.
Don’t try to steal any personal, financial data on Internet.
Don’t make duplication of any copyrighted material like books, magazines, designs,
programs, etc. without the permission of the author.
Don’t give any personal information of yours or anyone on Internet.
Don’t arrange to meet any unauthorized person met on the Internet.
9. Define the term Cyber Law. Why the need of Cyber law arises? Or What is
Cyber Law?
Cyber Law refers to all the legal and regulatory aspects of Internet and the World
Wide Web. Cyber-space is governed by a system of law and regulation called cyber
law.
Need of Cyber Law:
Today millions of people are using the Internet all over the world.
Because of global communication, Internet is misused for criminal an activity which
requires regulation.
Today many disturbing and unethical things are happening in the cyber space called
cyber crimes.
People with intelligence and having bad intention are misusing the aspect of the
Internet.
The criminal activities include various crimes like harassment, e-mail, cyber-stalking,
transmission of harmful programs, unauthorized possession of computerized
information, software piracy, etc.
Hence there is need for cyber law.
The original Act contained 94 sections, divided in 13 chapters and 4 schedules. The
laws apply to the whole of India. Persons of other nationalities can also be indicted
under the law, if the crime involves a computer or network located in India.
The Act provides legal framework for electronic governance by giving recognition to
electronic records and digital signatures. It also defines cyber crimes and prescribed
penalties for them.
Copyright is the exclusive right to do or authorize the others to do the acts like
perform the work in public, make any movie film or sound recording, make any
translation of the work, to reproduce the work, etc..
It is illegal for anyone to violate any of the rights provided by the Act to the owner of
copyright.
If you develop any work originally, then you can place the copyright symbol ©next to
your name, work.
The fair use of a copyrighted work for purposes such as criticism, comment, news
reporting, teaching, scholarship or research.
Even for this uses, whether a specific use is fair or not depends on number of factors
like, the purpose of the use, nature of the copyrighted work, amount of used work,
effect of the use upon the potential market for the value of the copyrighted work.
Advantages of Fair use:
Public would be able to access any copyrighted material without paying any fees or
asking permission.
If partial work is to implemented, then fair use is the better choice.
E-Commerce
E-Commerce is more than just buying and selling products online.
Instead, it encompasses the entire online processes of developing,
marketing, selling, delivering, and paying for products and services
purchased on internet.
E-Commerce definition (textbook)
Electronic Commerce (e-Commerce) is a general concept covering
any form or information exchange executed using information and
communication technologies.
E-Commerce takes place between companies, between
companies and their customers, or between companies and public
administrations. Electronic Commerce includes electronic trading of
goods, services and electronic material.
Business-to-consumer (B2C):
It is the model taking businesses and consumers interaction. The basic
concept of this model is to sell the product online to the consumers.
B2c is the direct trade between the company and consumers. It provides
direct selling through online. For example: if you want to sell goods and
services to customer so that anybody can purchase any products
directly from supplier’s website.
Business sells to the public typically through catalogs utilizing shopping
cart software. (i.e. typical online buying)
Customer identifies a need. Searches for the product or services to
satisfy the need.
Selects a vendor and negotiates a price.
Receives the product or services (delivery logistics, inspection and
acceptance) makes payment. Gets service and warranty claims.
Example websites like Amazon.com. Flipkart, etc.
Consumer-to-consumer (C2C)
It facilitates the online transaction of goods or services between
two people.
Consumer-to-consumer (C2C) (or citizen-to-citizen) model involves
the electronically facilitated transactions between consumers through
some third party.
A common example is the online auction, in which a consumer
posts an item for sale and other consumers bid to purchase it.
The sites are only intermediaries, just there to match consumers
Example: OLX, eBay.
Scope of E-Commerce
E-Commerce uses three technologies:
Electronic Markets
Electronic Data Interchange (EDI)
Internet Commerce:
Q. Write a note on Electronic Market.
Electronic Market
An electronic market is an information system (virtual market) that
provides facilities for buyers and sellers to exchange information about
price and product offerings.
Electronic market also tends to be available only to the
intermediaries.
Electronic Market brings together product, price and service
information from many suppliers
Electronic Market can thus act as database or catalogue.
Electronic market is the virtual representation of physical market.
Electronic markets are used for passenger ticket reservations, an
airline booking system and in various financial and commodity markets.
These markets give the customer (or the customer's intermediary)
easy access to comparative data on price, and other attributes, of the
goods or services on offer.
Access to this information is advantageous for the consumer but
making the information available is not necessarily beneficial to the
supplier.
Usage of Electronic Markets
Q. Explain Firewall.
Firewall is the most commonly accepted network protection.
Firewall is barrier between two networks used to control and monitor all
traffic between external network and local network.
It allows full access to insiders for services of the external world, while it
grants access to the external network based on log-on name, password,
IP address, etc..
Firewall is a system containing a router, a personal computer and a host.
It examines incoming and outgoing packets as per the set rules.
Q. Explain Encryption.
Encryption is the conversion of data into a coded format so that it cannot
be read by unauthorized third party users.
The data is converted into the code by the sender and then decoded by
the receiver.
Only sender and receiver know the rules for encoding and decoding.
The encryption process consists of an algorithm and a key. Key controls
the algorithm.
Only the sender and receiver of the message know the key.
Original message referred to as plain text is converted into random text
called cipher text.
It is transmitted to the receiving end and at this end the cipher text can
be transformed back to the original plain text by using a decryption
algorithm.
4. Javascript
Lesson No.4 Client Side Scripting
using JavaScript
Lesson Summary
JavaScript
JavaScript is a web scripting language.
It is an object-oriented language.
Initially, It was called live script.
It was created by Brendan Eich at Netscape.
It was first available in the web browser Netscape
Navigator version 2.
It is used along with the HTML pages either in the body
section or head section inside the
<script> </script> tags.
It is used for validations of data.
It is used to create dynamic web pages.
It can capture events (actions done by users) and
execute a code.
JavaScript is case sensitive language.
Abbreviations
ASP - Active Server Pages
API - Appliction Programing Interface
JDBC - Java Database Connectivity
DOM - Document Object Model
BOM - Browser Object Model
W3C - World Wide Web Consortium
NaN - Not a Number
Variables
JavaScript variables are containers for storing data
values.
var keyword is used to declare variables.
All JavaScript variables must be identified with unique
names.
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 _
Names are case sensitive (y and Y are different
variables)
Reserved words (like JavaScript keywords) cannot
be used as names
JavaScript variable names are case-sensitive.
Local variable - variable declared within procedure
or function.
Operators
JavaScript operators are symbols that are used to perform operations on operands.
There are following types of operators in JavaScript.
Arithmetic Operators
- + / *
%(Modulus) - To find remainder of division of two numbers
++(increment)
--(decrement)
Comparison (Relational) Operators
== Is equal to
=== Identical (equal and of same type)
!= Not equal to
!== Not Identical
> Greater than
>= Greater than or equal to
< Less than
<= Less than or equal to
Bitwise Operators
& Bitwise AND
| Bitwise OR
^ Bitwise XOR
~ Bitwise NOT
<< Bitwise Left Shift
>> Bitwise Right Shift
>>> Bitwise Right Shift with Zero
Logical Operators
&& Logical AND
|| Logical OR
! Logical Not
Assignment Operators
= Assign
+= Add and assign
-= Subtract and assign
*= Multiply and assign
/= Divide and assign
%= Modulus and assign
Special Operators
(?:) Conditional Operator returns value based on the condition. It is like if-else.
, Comma Operator allows multiple expressions to be evaluated as single statement.
delete Delete Operator deletes a property from the object.
in In Operator checks if object has the given property
instanceof checks if the object is an instance of given type
new creates an instance (object)
typeof checks the type of object.
void it discards the expression's return value.
yield checks what is returned in a generator by the generator's iterator.
Comments in JavaScript
// - single line comments
/* */ - multiple line comments
Functions
A JavaScript function is a block of code designed to
perform a particular task.
A JavaScript function is executed when "something"
invokes it (calls it).
It is a block of JavaScript code that performs a specific
task and returns a value.
A function id defined by using keyword "function".
E.g.
<script>
function msg() {
alert("hello! this is message");
}
</script>
<input type="button" onclick="msg()" value="call functio
n"/>
Objects in JavaScript
Window Object
Window object is a top level client side object for each
window or frame.
Properties:
Property Description
Returns the Location object for the
location
window
Returns the Document object for the
document
window
name Sets or returns the name of a window
Sets the text in the status bar of browser
status
window
Returns a Boolean value indicating
closed
whether a window has been closed or not
Methods:
Method Name Description
converts the string passed into
parseInt( )
number/integers.
Displays an alert box with a message and
alert( )
an OK button
blur( ) Removes focus from the current window.
open( ) Opens a new Browser windwow.
close( ) Closes the current window
Displays a dialog box with a message and
confirm( )
an OK & a Cancel button
focus( ) Sets the focus to the current window
print( ) Prints the content of the current window
Displays a dialog box that prompts the
prompt( )
visitor for input.
Calls a function or evaluates an
setTimeout( ) expression after a specified number of
milliseconds.
Calls a function or evaluates an
setInterval( )
expression at specified intervals.
clearInterval( ) clears a timer set with setInterval( ).
clearTimeout( ) clears a timer set with setTimeout( ).
Navigator Object
The navigator object is used for browser detection and
can return useful infromation about the visitor's browser
and system. It can be used to get browser information
such as appName, appCodeName, userAgent etc.
Properties:
Property Description
Returns the code name of the Client's
appCodeName
browser
appName Returns the name of the Client's browser
Returns the version information of the
appVersion Client's browser
userAgent property returns the user-
useragent agent header sent by the browser to the
server
Document Object
Document object is created when HTML document is
loaded into the browser.
Properties:
Property Description
specifies the title of the document on the
title
Browser's title bar.
bgcolor Gives background color to the document.
URL Specifies URL of the docuemtn.
Methods:
Method
Description
Name
write( ) Helps to display string into document windwow.
writeln( ) Displays string into docuement on new line
Events:
Event can be something the browser does, or something
a user does.
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 too is an event.
Other examples include events like pressing any key,
closing a window, resizing a window, etc.
Events are the signals generated when specific
action occurs.
Events List
click
dblclick
mouseover
mouseout
blur
focus
abort
load
unload
reset
select
keypress
keydown
keyup
Event Handler
An event handler typically is a software routine that
processes events - actions such as keystrokes and
mouse movements.
Event handlers are triggered in the browser by user
actions.
Frame/Object Events
onload - The event occurs when an object is loaded.
When a page is loaded into the Web Browser.
onunload - event occurs once a page has unloaded
(user leaves)
onerror - The event occurs when an error happens
during loading of a docuement or image.
onabort - event occurs when an image is stopped from
loading before completely loaded.
onblur - event occurs when the focus is removed from
an form element or window.
onfocus - event occurs when an element gets focus.
onselect - event occurs when user selects some text.
onchange - The event occurs when the value of form
field is changed by the user.
onsubmit - The event occurs when a form is submitted.
onreset - event occurs when a form is reset.
Mouse Events
onclick - event occurs when user clicks in the
document or on a link or form element.
(is the only event handler for radio button)
ondblclick - event occurs when the user clicks in the
document twice .
onmouseover - The event occurs when the user moves
the pointer over an object.
onmouseout - The event occurs when the user moves
the pointer off a clickable area.
onmousedown - event occurs when the user presses a
mouse button over an element.
onmouseup - event occurs when the user releases a
mouse button over an element.
Keyboard Events
onkeydown - event occurs when the user is pressing a
key.
onkeypress - event occurs when the user presses a
key.
onkeyup - event occurs when the user releases a key.
Important Functions
confirm( ) - Displays a dialog box with an OK and
cancel button.
prompt( ) - Displays a dialog box that prompts the
visitor to input.(accepts data from user)
alert( ) - Displays an alert box with a message and OK
button.
eval( ) - used for evaluating a strin representing
arithmetic expression.
indexOf( ) - used to search for the specified character in
a string. Returns the index vlaue of the first occurence.
Find a certain string is present within a given string.
lastindexOf( ) - used to search for the specified
character in a string. Returns the index vlaue of the last
occurence.
substring( ) - used to extract a subset or certain portion
of string.
parseInt( ) - used to convert string
into number/integer.
parseFloat( ) - used to convert string into floating point
number.
getDay( ) - method of the Date object returns the
weekday in number.
getMonth( ) - method of the Date object returns the
month in number.
getYear( ) - method of the Date object returns year part
from the date.
charAt( ) - method of String returns the character at the
specified index value.
toLowerCase( ) - method of String object returns string
into lowercase.
cInt( ) -converts character to number
Short Questions
1. What is JavaScript?
2. Explain Client-side Scripting.
3. Explain Server-side Scripting.
4. Give the difference between Client-side and server side scripts.
5. What is Document Object? List any 5 properties of doucment object
6. Explain any four built-in fucntions in JavaScript.
7. How to write function in JavaScript?
Web Application
Web Application is an application that uses a web browser as a client.
In a Client-Server environment –
Examples
.NET FRAMEWORK
It is a software technology that is accessible with latest Microsoft Windows Operating
System.
It is Microsoft's Managed Code programming model for building applications on
Windows Clients, Servers and mobile or embedded devices.
For Windows 2003 and above the .NET Framework is installed automatically as a
part of the operating system.
.NET Framework is a platform that provides tools and technologies needed to build
Networked Applications, Distributed Web Services and Web Applications.
.NET Framework is based on object oriented programming environment.
It is the technology for building dynamic Web applications.
It is an important Windows component that supports developing and executing the
next generation of applications and XML Web services.
The main function of Common Language Runtime (CLR) is to convert the Managed
Code into native code and then execute the Program.
It works as a layer between Operating Systems and the applications written in .NET
languages that confirms to the CLS.
The runtime automatically handles object layout and manages objects and replaces
them when they are no longer being used.
Namespaces
Namespaces allows organizing classes, so that they can be easily accessed in other
applications.
Namespaces are the names which do not represent location.
It enable to avoid any naming conflicts between classes that have the same name.
Assembly
An assembly is a collection of types and resources that forms a logical unit of
functionality.
Assembly is stored as an .exe or .dll file.
ASP.NET
It is a technology for building powerful, dynamic web aplications.
ASP.NET is a pre-compiled.
ASP.Net is designed to work with the HTTP protocol. This is the standard protocol
used across all web applications.
ASP.NET PAGES
ASP.NET files have the extension .aspx
ASP.NET pages contain directives that allows specifying page properties &
configuration information for the page.
The directives are used by ASP.NET as instructions for how to process the page, but
they are not rendered as part of the markup that is sent to the browser.
Application directives specify optional application-specific settings used by the
ASP.NET parser when processing.
Code-declaration blocks
Language attribute specifies language used in code declaration block.
The runat attribute specifies that the code contained in script block runs on the
server.
The src attribute specifies path and file name of an external script file to load.
<script runat="server" language="VB" src="filepath".
</script>
Visual Studio.NET
The Visual Studio is the tool used for desing, develop, debug and develop Web
applications and traditional client applications.
Every Visual Basic project has a project file with an extension of vbproj.
Solution Explorer
It provides an organized view of the projects and their files.
Class View
It displays the symbols defined, referenced or called in the application for
developing. The Class View toolbar allows to add virtual folders and to navigate
within the objects and member panes.
Properties Window
It is used to view and change the design-time properties and events of selected
objects from web form to editors and designers. It is alos used to edit and view
file, project, and solution properties.
Object Browser
It allows to select and examine the symbols available which are used in the projects.
Code Editor
The Visual Studio.NET Code editor is also known as the Text Editor.
Design View
The Design view displays ASP.NET Web pages, master pages, content pages,
HTML pages and user controls using a near WYSIWYG view.
Source View
The Source view displays the HTML markup for the Web page, which can be edited.
Control Class
The Control Class implements very basic functionality required by classes that
display information to the user. IT handles user input through the keyboard and
pointing devices.Control Class handles message routing and security.
ASP.NET Controls
ASP.NET Web Server Controls
Web Server Controls are objects on ASP.NET web pages that run when the page
is requested and render markup to a browser.
It contains classes that are rendered as HTML tags, such as the TextBox control and
the ListBox control.
The WebControl class serves as the base class for many of the classes in
theSystem.Web.UI.WebControls namespace.
Validation
Validation is the testing process to determine whether value entered by visitor inot
field is valid or not.
Validation Server Controls
ASP.NET provides Validaton Server controls to compare user input in different fields
or against values that might be held in other controls, such as textbox, database etc.
Namespace - System.Web.UI.WebControls
Assembly - System.Web (in System.Web.dll)
CompareValidator - allows for comparisons between the user's input and another
item using a comparison operator(equals, greater than, less than, and so on)
RangeValidator - checks the user's input based upon a lower and upper-level range
of numbers or characters.
HttpResponse
- manages HTTP output to the client.
Properties:
Buffer
BufferOutput
CHarset
Cookies - gets the response cookie collection, contains new cookies created on the
server and transmitted to the client in the Set-Cookie header.
Expires
Headers
Output
Method :
BinaryWrite - Writes a string of binary characters to the HTTP output stream.
Clear - Clears all content output from the buffer stream.
End - Sends all currently buffered output to the client,
Flush - Sends all currently buffered output to the client.
Write - Writes a string to an HTTP response output stream.
HttpRequest
HttpRequest enables ASP.NET to read and the HTTP values sent by a client during
a Web request.
The query string and fields on an HTML form that are available from an HTTP
request.
Properties:
Browser - Gets or sets information about the requesting client's browser capabilities.
Cookies - Gets a collection of cookies sent by the client.
- contains cookies transmitted by the client to the server in the Cookie header.
Methods:
ToString - It converts an object to its string representation.
ValidateInput - It sets flags so that when they get accesses for the Cookies, Form,
or Query String. It checks all input data against a hard-coded list of potentially
dangerous data.
Global.asax
The Global.asax file also known as the ASP.NET application file, is an optional file
that contains code for responiding to application-level and session-level events
raised by ASP.NET or by HTTP modules.
@Application difective can be used only in Global.asax files, while the other
directives are used in other ASP.NET files such as Web pages (.aspx files) and user
controls (.asex files)
Application directives specify optional application-specific settings used by the
ASP.NET parser when processing.
Cookies
A cookie is a small bit of text or small amount of data that is stored either in a text file
on the client files system or in-memory in the client browser session.
The cookie contians information the Web application can read whenever the user
visits the site.
Cookies can be temporary (with specific expiration times and dates) or persistent.
The cookies is used to store information about a particular client, session or
application.
Short Questions:
Explain the basic principle of ASP.NET
What is CLR?
Define CLS
Define FCL
Explain Advantages of ASP.NET
Explain difference in the processing of single-file pages and Code-behind -
Ans. Page No. 113 of text book
Define Web Server Controls
Define Html Server Controls
Define the method flush() and write(string) opf Http response class
Define the method Clear and End
Explain Server variables in ASP.NET.
6. DB with ASP.NET
Lesson No. 6 Database Concepts and
Interaction with ASP.NET
Lesson Summary
Important Terms
Data – Collection of facts (unorganized)
Information – Processed data (manipulated data to produce results)
Database – Collection of related information grouped together
RDBMS – Relational Database Management System E.g. Oracle, MySQL, Access, MS SQL
server
MS Access is an RDBMS software.
Database Objects – Table, Query, Form, Report
Table
Table – Grid (collection) of rows and columns, where data is stored.
One to One – a field in one table is associated with one field of another table and vice versa.
One to Many – a field in one table is associated with more than one fields in another table.
Many to Many – a field in many table is associated with more than one fields in another
table.
SQL clauses
SELECT – To query a table, to select a table and access data from the database.
FROM – specifies the name of table (compulsory clause in Select)
ORDER BY – To sort the table rows in ascending or descending order. Keywords – ASC
and DESC
WHERE – To define criteria for rows to selected for output
GROUP BY – To group records on values of a field
INSERT – To add the records in database
MS Access - Reports
Report – Reports are based on table or query.
IT is used to display records in the prescribed form.
It is a printable presentation of data gathered from a query.
They are used to view, format, print and to summarize data.
The data displayed on report cannot be edited.
Report design has total 3 sections.
Reports can be created from Design view and Report Wizard
MS Access - Form
Form – Forms provide users with an easy-to-read interface where they can enter table data.
It displays data from one or more table.
Data can be inserted, updated, or deleted from a table using a Form object.
Data entry forms are primary means of entering data into tables of the database.
ODBC provides a uniform access to data stored in different formats and databases.
We communicate with a database through ASP using ActiveX Data Object (ADO)
DSN – Data Source Name Types – File, System, User
ADO.NET
ADO stands for ActiveX Data Objects.
It is a Microsoft Technology.
ADO is a Microsoft Active-X component.
It is a programming interface to access data in a database.
It provides consistent access to data sources such as MS SQL Server, MS Access and other
data sources through OLE DB and XML.
ADO provides an object oriented programming interface for accessing data source such as
SQL Server.
Abbreviations
ADODB – ActiveX Data Object Database
OLE – Object Linking and Embedding
OLEDB – Object Linking Embedding Database
ODBC – Open Database Connectivity
JDBC - Java Database Connectivity
ADO.NET Objects
ADO Connection Object – used to create an open connection to a data source. Types of
connection depends on what database system you are working. E.g. SqlConnection,
OleDbConnection, OdbcConnection
Connection.Open statement of connection object open the database.
ODBC driver should be installed and a data source name should be provided while using an
ODBC data source.
Data Adapter Object – is a integral part of the ADO.NET which serves as a bridge between
a DataSet and Data Source. The DataAdapter can perform Select, Insert, Update and
Delete, SQL operations in the Data Source.
Command object – executes SQL statements and Stored Procedures against the Data
source in the Connection object.
Datareader – Used to retrieve the result set, It reads data from data store in forward only
mode
The DataRelation object stores information about related tables, including which columns
contain the primary keys and foreign keys that link the tables.
Short Questions
Define Data and Database
Explain the types of Relationships that can be created in MS-Access.
Define the term Record and Field.
What are data types in Access?
Explain the concept of Primary key in MS-Access.
Define the term Table and Queries
What is Query? Explain used of Query
Explain various methods of report creation.
What is SQL? Explain need of SQL.
Explain the terms ADO, OLEDB, ODBC nand DSN
Explain the ADO.NET objects: Command, Connecton and Recordset
Explain SQL Statements.
Explain AccessDataSource Control and its properties