Saturday, October 8, 2011

MCSL-016, (JAVA SCRIPT) INTERNET CONCEPTS AND WEB DESIGN , INTERNET CONCEPTS & WEB DESIGNING, INDIRA GANDHI NATIONAL OPEN UNIVERSITY, SCHOOL OF COMPUTER & INFORMATION SCIENCES, LAB MANUAL, (HTML, ADVANCED HTML, JAVA SCRIPT, VBScript (V.B. Script), Dreamweaver, (INDIRA GANDHI NATIONAL OPEN UNIVERSITY NOTES, IGNOU NOTES, IGNOU ASSIGNMENTS, IGNOU FIRST SYMESTER, IGNOU QUESTION PAPERS); IGNOU PROSPECTUR, IGNOU SYLLABUS, IGNOU MCA NOTES; MCA IGNOU - FIRST YEAR; MCA - IGNOU - SYM 1

MCSL-016, LAB MANUAL (JAVA SCRIPT)
SECTION 3

INTERNET CONCEPTS AND WEB DESIGN, INTERNET CONCEPTS & WEB DESIGNING, INDIRA GANDHI NATIONAL OPEN UNIVERSITY, LAB MANUAL, (HTML, ADVANCED HTML, JAVA SCRIPT, VBScript (V.B. Script), Dreamweaver, (INDIRA GANDHI NATIONAL OPEN UNIVERSITY NOTES, IGNOU NOTES, IGNOU ASSIGNMENTS, IGNOU FIRST SYMESTER, IGNOU QUESTION PAPERS); IGNOU PROSPECTUR, IGNOU SYLLABUS, IGNOU MCA NOTES; MCA IGNOU - FIRST YEAR; MCA - IGNOU - SYM 1 :

ACCORDING TO YEAR 2011 (JULY - JANUARY SESSION - SYLLABUS)
NOTE : These are our / my personal Notes - I suggest you (students) to please follow your own syllabus and/ or books as these are my/ our personal and modified notes - for my personal use only, Thanks.

 =========================================================

1.3 Java ScriptSession
14.How would you write any statement using only one write or writeln()

command?<html><head></head><script language="JavaScript">function

newpages(){document.writeln("Hi ");document.write("Welcome To My

Website");}</script><body><form name="form1" method="post" action="">

<p><input type="submit" name="Submit" value="Enter" onClick="newpages

()"></p></form></body></html>


5.Embed java script in html document asking user name and then

printing Hello<user Name>

<html><head></head><script language="JavaScript">function newpages

(txt){document.writeln("Hello " + txt);}</script><body><form

name="form1" method="post" action=""><p>Enter User Name<input

name="t1" type="text" id="t1"></p><p><input type="submit"

name="Submit" value="Enter"onClick="newpages

(form1.t1.value)"></p></form></body></html>



6.Create a dialogue box with “Welcome to my website” message.
<html><head></head><script language="JavaScript">alert("Welcome to my

website");</script><body></body></html>

=================================
Session 2
1.Evaluate the expressiona.
Ans. 7+5b. “7”+”5”c. 7*5d. 7/5e.7%5<html><head></head><script

language="JavaScript">function Calculate(choice){var result;switch

(choice)
{case 1:result=7+5; break;case 2:result="7" + "5"; break;case

3:result=7*5; break;case 4:result=7/5; break;case 5:result=7%5;

break;}document.writeln(result);}</script><body><form name="form1"

method="post" action=""> <p>Evaluate The

Expression</p><p><label><input type="radio" name="RadioGroup1"

value="radio"onClick="Calculate(1)">7+5</label><br><label><input

type="radio" name="RadioGroup1" value="radio"onClick="Calculate

(2)">"7" + "5"</label>
<br><label><input type="radio" name="RadioGroup1"

value="radio"onClick="Calculate(3)">7*5</label><br><label><input

type="radio" name="RadioGroup1" value="radio"onClick="Calculate

(4)">7/5</label><br><label><input type="radio" name="RadioGroup1"

value="radio"onClick="Calculate

(5)">7%5</label><br></p></form></body></html>



2. Write the segment of script that would ask the user if he wants a

greetingmessage and if he does, display a gif file called Welcome. gif

and display“Welcome to Netscape navigator!” in the document window

following the gif.<html><head></head><script

language="JavaScript">function messages(){input_box=confirm("Do You

Want a Greeting");if(input_box==true){window.open

("welcome.jpg");window.document.write("Welcome to Netscape navigator!"

);}else{alert("You Have Selected No");}}</script><body><form

name="form1" method="post" action=""><input type="submit"

name="Submit" value="Submit" onClick="messages

()"></form></body></html>



3.Write the object definition for an object called car with four

properties model,make, year and price.
<html><head><script language="JavaScript">var car=new

Object;car.model="Marcides

Benz";car.year=2008;car.make="DX";car.price=4500000;</script></head><s

cript language="JavaScript">function printdet(){document.write(" Model

: " + car.model);document.write(", Make : " +

car.make);document.write(", Year : " + car.year);document.write(",

Price : " +car.price);}</script><body><form name="form1" method="post"

action=""><input type="submit" name="Submit" value="Print Details"

onClick="printdet()"></form></body></html>



1.Write a program to display a multiplication

table.<html><head></head><script language="JavaScript">function

multable(){var num=prompt("Enter The No");var i;for(i=0;i<=10;i++)

{document.write(num + " * " + i + " = " + num*i +"<br>");}}

</script><body><form name="form1" method="post" action=""><input

type="submit" name="Submit" value="Print Details"onClick="multable

()"></form></body></html>



2.Write code to create a scrolling text.<html><head></head><script

language="JavaScript">function movetext(){if(txt.style.posLeft<720)

{txt.style.posLeft=txt.style.posLeft+2;window.setTimeout("movetext

()",5);}else{txt.style.posLeft=0;window.setTimeout("movetext()",5);}}

</script><body onLoad="movetext()"><form name="form1" method="post"

action=""><div id="txt"

style="position:relative;top:3;left0"><h2>Scrolling

Text</h2></div></form></body></html>


Session 42. Write a program to change color of text

randomly<html><head><script language="JavaScript">var colors=new

Array(6);colors[0]="#0000FF"; colors[1]="#FF0000"; colors[2]

="#006600";colors[3]="#FFCC00";colors[4]="#00FFFF"; colors[5]

="#000000";var i=1;</script></head><script

language="JavaScript">function changecolor(){ document.fgColor=colors

[i];i++;if(i>5)i=0;setTimeout("changecolor()",100);}</script><body

onLoad="changecolor()"><div align="center"><strong><font

size="7">Hello </font></strong> </div></body></html>


3.Create a web page using two image files, which switch b/w on another

as themouse pointer moves over the image. Use on mouse over and on

mouse out eventhandler.<html><head><script

language="JavaScript">function MM_swapImgRestore() {var

i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)

x.src=x.oSrc;}function MM_preloadImages() {var d=document; if

(d.images){ if(!d.MM_p) d.MM_p=new Array();var

i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length;i

++)if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a

[i];}}}function MM_findObj(n, d) {var p,i,x; if(!d) d=document; if

((p=n.indexOf("?"))>0&&parent.frames.length) {d=parent.frames

[n.substring(p+1)].document; n=n.substring(0,p);}if(!(x=d[n])&&d.all)

x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++)x=d.forms[i][n];for

(i=0;!x&&d.layers&&i<d.layers.length;i++)x=MM_findObj(n,d.layers

[i].document);if(!x && d.getElementById) x=d.getElementById(n); return

x;}function MM_swapImage() {var i,j=0,x,a=MM_swapImage.arguments;

document.MM_sr=new Array;for(i=0;i<(a.length-2);i+=3)if

((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc)

x.oSrc=x.src; x.src=a[i+2];}}</script></head><body

onLoad="MM_preloadImages('welcome.JPG')"><a href="#"

onMouseOut="MM_swapImgRestore()"onMouseOver="MM_swapImage

('Image1','','welcome.JPG',1)"><imgsrc="Img1.jpg" name="Image1"

width="261" height="195" border="0"></a></body></html>


Session 52 . Use the date function get & set date to prompt the user

for an integer b/w 1-31 &return day of the week it

represents.<html><head></head><script language="JavaScript">function

setdate(){var dt=new Date();dt=new Date

(form1.y.value,form1.m.value,form1.d.value);form1.gt.value=dt.getDate

() + "/" + dt.getMonth() + "/" +dt.getFullYear();}</script><body><form

name="form1" method="post" action=""><p>Day <input name="d"

type="text" id="d" size="3">Month <input name="m" type="text" id="m"

size="3">Year <input name="y" type="text" id="y" size="4"><input

type="button" name="Button" value="SetDate" onClick="setdate

()"></p><p> Date <input name="gt" type="text" id="gt">

</p></form></body></html>


2.Display time and print the message accordingly e.g Good morning in

morning etc.<html><head><script language="JavaScript">var dt=new Date

();document.write("Good Morning The Time Is : " + dt.getHours() +":" +

dt.getMinutes() + ":" + dt.getSeconds

());</script></head><body></body></html>


Session 61.Using java script create a digital

clock.<html><head></head><script language="JavaScript">function

getTimes(){var dt=new Date();form1.t.value= dt.getHours() + ":" +

dt.getMinutes() + ":" + dt.getSeconds();window.setTimeout("getTimes

()",1000);}</script><body onLoad="getTimes()"><form name="form1"

method="post" action=""><input name="t" type="text"

id="t"></form></body></html>


Session 71.Using java script create a

calculator.<html><head></head><script language="JavaScript">function

calc(ch){if(ch=="=")form1.t.value= eval(form1.t.value);elseif

(ch=="C")form1.t.value= "";elseform1.t.value+=ch;}</script><body

onLoad="getTimes()"><form name="form1" method="post" action=""><input

name="t" type="text" id="t"><br><input type="button" name="Button"

value="7" onClick="calc('7')"><input type="button" name="Submit2"

value="8" onClick="calc('8')"><input type="button" name="Submit3"

value="9" onClick="calc('9')"> <input type="button" name="Submit4"

value="+" onClick="calc('+')"><br><input type="button" name="Submit5"

value="4" onClick="calc('4')"><input type="button" name="Submit6"

value="5" onClick="calc('5')"><input type="button" name="Submit7"

value="6" onClick="calc('6')"><input type="button" name="Submit8"

value="-" onClick="calc('-')"><br><input type="button" name="Submit9"

value="1" onClick="calc('1')"><input type="button" name="Submit10"

value="2" onClick="calc('2')"><input type="button" name="Submit11"

value="3" onClick="calc('3')"><input type="button" name="Submit12"

value="*" onClick="calc('*')"><br><input type="button" name="Submit13"

value="0" onClick="calc('0')"><input type="button" name="Submit14"

value="C" onClick="calc('C')"><input type="button" name="Submit15"

value="=" onClick="calc('=')"><br></form></body></html>


Session 81.Create a web page with a textbox and check for validation.

If empty displaymessage and set focus to it, if filled display thank

you.<html><head></head><script language="JavaScript">function check()

{if(form1.t.value==""){alert("Enter The Text");form1.t.focus();}else

{alert("Thank You");}}</script><body><form name="form1" method="post"

action="">Enter a Text<input name="t" type="text" id="t"><input

type="submit" name="Submit" value="Submit" onClick="check

()"></form></body></html>


Session 111. Create a program to generate a hit counter

<html><head></head><script language="JavaScript">var

counter;counter=0;function count(){counter++;alert("Counter : " +

counter);}</script><body><form name="form1" method="post"

action=""><div align="center"><input type="button" name="Button"

value="Hit Me" onClick="count()"></div></form></body></html>


2.Create a program to check email address provided by the user is

valid or invalid.<html><head></head><script

language="JavaScript">function check(){if(form1.t.value==""){alert

("Enter The Text");form1.t.focus();}else{var

email,a,d,diff,k,c;email=form1.t.value;a=email.indexOf

('@');d=email.indexOf('.');diff=parseInt(d)-parseInt(a);k=parseInt

(d)+1;c=email.charAt(k);if(a<1||diff<=1||c==""){alert("Invalid Email

ID");form1.t.focus();}}}</script><body><form name="form1"

method="post" action="">Enter Email ID <input name="t" type="text"

id="t"><input type="submit" name="Submit" value="Submit"

onClick="check()"></form></body></html>


Session 121.Write a program to scroll the text on status

bar.<html><head></head><html><head></head><script

language="JavaScript">var ar="Scrolling Text";var space="";var

i;i=1;function count(){var cont,k=0;cont="";while(k<=i){cont=cont + "

";k++;}status=cont +ar;i++;if(i>100)i=0;window.setTimeout("count

()",5);}</script><body onLoad="count

()"></body></html><body></body></html>



2. Write a program to create a small window in a main

window.<html><head><script language="JavaScript">window.open

("newwindow.html");</script></head><body></body></html>


Session 151.Use java script for authentication and verification of the

text boxes in the staticsite developed by the student in the html

exercise.<html><head></head><script language="JavaScript">function

check(){if(form1.t.value==""){alert("Enter The

Username");form1.t.focus();}else if(form1.t2.value==""){alert("Enter

The Password");form1.t2.focus();}else{if((form1.t.value!="")||

(form1.t2.value!=”")){alert("Invalid Username or Password");}}}

</script><body><form name="form1" method="post" action=""><p>User Name

<input name="t" type="text" id="t"> </p><p>Password <input name="t2"

type="password" id="t2"> </p><p> <input type="button" name="Button"

value="Button" onClick="check()"></p></form></body></html>


a.VB ScriptSession 11.Write a program to display the following on a

web pageHello <User Name><html><head></head><script

language="VBScript">sub newpages(txt)document.writeln("Hello " + txt)

end sub</script><body><form name="form1" method="post"

action=""><p>Enter User Name<input name="t1" type="text"

id="t1"></p><p><input type="submit" name="Submit"

value="Enter"onClick="newpages

(form1.t1.value)"></p></form></body></html>

2.Create a web page that display a message box with the

message“welcome to my web site”<html><head></head><script

language="VBScript">sub msgs()msgbox("Welcome To My Web Site")end

sub</script><body><form name="form1" method="post" action=""><p>

<input type="submit" name="Submit" value="Message"onClick="msgs()">

</p></form></body></html>



3.Write code to change color of text

randomly.<html><head></head><script language="VBScript">dim colors(5)

colors(0)="#0000FF"colors(1)="#FF0000"colors(2)="#006600"colors(3)

="#FFCC00"colors(4)="#00FFFF"colors(5)="#000000"dim ii=0sub

changecolor()msgbox("Welcome To My Web Site")document.fgColor=colors

(i)i=i+1if(i>5) theni=0end if window.setTimeout("changecolor()",100)

end sub</script><body onLoad="changecolor()"><div

align="center"><strong><font size="7">Hello </font></strong>

</div></body></html>


Session 21.Write a VB Script code that accepts the length, breadth and

height and display thearea of a rectangle.<html><head></head><script

language="VBScript">sub area()dim l,b,h,ar 40 
l=form1.l.value b=form1.b.valueh=form1.h.valuear=l*b*hmsgbox("Area " &

ar)end sub</script><body onLoad="changecolor()"><form name="form1"

method="post" action="">Length <input name="l" type="text"

id="l">Breadth <input name="b" type="text" id="b">Height <input

name="h" type="text" id="h"><br><input type="button" name="Button"

value="Area" onClick="area()"></form></body></html>


2.Create a programme to generate a hit counter

<html><head></head><script language="VBScript">dim counter

counter=0sub count()counter=counter+1msgbox("Counter : " & counter)end

sub</script><body><form name="form1" method="post" action=""><div

align="center"><input type="button" name="Button" value="Hit Me"

onClick="count()"></div></form></body></html>


Session 31.Using vbscript create a calculator

<html><head></head><script language="VBScript">sub calc(ch)if(ch="=")

then form1.t.value= eval(form1.t.value)elseif(ch="C")

thenform1.t.value= ""elseform1.t.value=form1.t.value & chend if end if

end sub</script><body onLoad="getTimes()"><form name="form1"

method="post" action=""><input name="t" type="text" id="t"><br><input

type="button" name="Button" value="7" onClick="calc('7')"><input

type="button" name="Submit2" value="8" onClick="calc('8')"><input

type="button" name="Submit3" value="9" onClick="calc('9')"><input

type="button" name="Submit4" value="+" onClick="calc('+')"><br><input

type="button" name="Submit5" value="4" onClick="calc('4')"><input

type="button" name="Submit6" value="5" onClick="calc('5')"><input

type="button" name="Submit7" value="6" onClick="calc('6')"><input

type="button" name="Submit8" value="-" onClick="calc('-')"><br><input

type="button" name="Submit9" value="1" onClick="calc('1')"><input

type="button" name="Submit10" value="2" onClick="calc('2')"><input

type="button" name="Submit11" value="3" onClick="calc('3')"><input

type="button" name="Submit12" value="*" onClick="calc('*')"><br><input

type="button" name="Submit13" value="0" onClick="calc('0')"><input

type="button" name="Submit14" value="C" onClick="calc('C')"><input

type="button" name="Submit15" value="=" onClick="calc

('=')"><br></form></body></html>


Session 41.Create a programme to check for null or empty

string<html><head></head><script language="VBScript">sub check()if

(form1.t.value="")thenmsgbox("Enter The Text")form1.t.focus()

elsealert("Thank You")end if end sub</script><body><form name="form1"

method="post" action="">Enter a Text<input name="t" type="text"

id="t"><input type="submit" name="Submit" value="Submit"

onClick="check()"></form></body></html>


2.Create a form that has e-mail field. Now Write VB Script code for

Validation.<html><head></head><script language="VBScript">sub check()

if(form1.t.value="")thenalert("Enter The Text")form1.t.focus()elsedim

email,a,d,diff,k,cemail=form1.t.valuea=InStr(1,email,"@")d=InStr

(1,email,".")diff=d-ak=d+1c=Mid(email, k, 1)if(a<1 or diff<=1 or

c="")thenalert("Invalid Email ID")form1.t.focus()end if end if end

sub</script><body><form name="form1" method="post" action="">Enter

Email ID <input name="t" type="text" id="t"><input type="submit"

name="Submit" value="Submit" onClick="check()"></form></body></html>



Session 51.List Mouse and Key events in vbscriptMouse Events :

MouseOver, MouseOutKey Events : KeyUp,KeyDown,KeyRelease,

KeyPress2.How do you create random numbers in vbscript?Random No is

Generated byRndFunction



Session 61.Create a form in HTML containing the following files and

then perform thevalidation of each field using VBScript. Name-

textboxAddress-textboxDate Of Birth-Combo boxEmail-

textbox<html><head></head><script language="VBScript">sub check()if

(form1.n.value="")thenalert("Enter The Name")form1.n.focus()elseif

(form1.a.value="")thenalert("Enter The Address")form1.a.focus()elseif

(form1.y.value="")thenalert("Enter The Year")form1.y.focus()elseif

(form1.d.value="")thenalert("Select The Day")form1.d.focus()elseif

(form1.m.value="")thenalert("Select The Month")form1.m.focus()elseif

(form1.mail.value="")thendim

email,a,d,diff,k,cemail=form1.t.valuea=InStr(1,email,"@")d=InStr

(1,email,".")diff=d-ak=d+1c=Mid(email, k, 1)if(a<1 or diff<=1 or

c="")thenalert("Invalid Email ID")form1.t.focus()end if end if end

sub</script><body><form name="form1" method="post"

action=""><p>Name<input name="n" type="text" id="n"><br>Address<input

name="a" type="text" id="a"><br>Date Of Birth : Day<select name="d"

id="d"

><option>1</option><option>2</option><option>3</option><option>4</opti

on><option>5</option><option>6</option><option>7</option><option>8</op

tion><option>9</option><option>10</option>

<option>11</option><option>12</option><option>13</option><option>14</o

ption><option>15</option><option>16</option><option>17</option><option

>18</option><option>19</option><option>20</option>

<option>21</option><option>22</option><option>23</option><option>24</o

ption><option>25</option><option>26</option><option>27</option><option

>28</option><option>29</option><option>30</option><option>31</option><

/select>Month<select name="m"

id="m"><option>Jan</option><option>Feb</option><option>Mar</option><op

tion>Aprl</option><option>May</option><option>Jun</option><option>July

</option><option>Aug</option><option>Sep</option><option>Oct</option><

option>Nov</option><option>Dec</option></select>Year <input name="y"

type="text" id="y" size="6"><br>Email Id <input name="mail"

type="text" id="mail"><br> <input type="button" name="Button"

value="Button"onClick="check()"></form></body></html>


Session 8
1.Create a program the accepts the time from the system clock and

accordinglydisplays a Good morning, Good Afternoon and Good Evening

message to the user <html><head></head><script language="VBScript">sub

wish()dim hh=Datepart("h",Now)if h>=1 and h<=12 thenmsgbox("Good

Morning")elseif h>=13 and h<=18 thenmsgbox("Good Afternoon")

elsemsgbox("Good Evening")end if end sub</script><body onLoad="wish

()"></body></html>


Session 91.Write a programme that uses For next Looping Statements to

create a FibonacciSeries.<html><head></head><script

language="VBScript">sub fib()dim a,b,ca=1 b=1document.write("First 10

Fibonacci Series<br>")document.write(a & "&nbsp;&nbsp;" & b &

"&nbsp;&nbsp;")for i=3 to 10c=cint(a)+cint(b)document.write(c &

"&nbsp;&nbsp;")a=b b=cnextend sub</script><body onLoad="fib

()"></body></html>


2.Using Do While display the factorial of a

number.<html><head></head><script language="VBScript">sub fact(n)dim

f,if=1i=1do while(i<=cint(n))f=cint(f)*cint(i)i=i+1loopdocument.write

("<br>Factorial Of " & n & " is " & f)end sub</script><body><form

name="form1" method="post" action=""><input name="n" type="text"

id="n"><input name="Button" type="button" onClick="fact

(form1.n.value)"value="Factorial"></form></body></html>

Session 101.Write a Program that displays the multiplication of two

matrices.<html><head></head><script language="VBScript">sub matmul()

dim m1(3,3),m2(3,3),m3(3,3),count,i,jcount=0msgbox("Enter First

matrix")for i=0 to 2for j=0 to 2m1(i,j)=inputbox("")nextnextmsgbox

("Enter Seconf matrix")for i=0 to 2for j=0 to 2m2(i,j)=inputbox("")

next nextdocument.write("<br>Product of two Matrix<br>")for i=0 to

2for j=0 to 2for k=0 to 2m3(i,j)=cint(m3(i,j))+cint(m1(i,k))* cint(m2

(k,j))nextnextnextfor i=0 to 2for j=0 to 2document.write(" " & m1

(i,j))nextdocument.write("<br>")nextdocument.write("<br>+<br>")for i=0

to 2for j=0 to 2document.write(" " & m2(i,j))nextdocument.write

("<br>")nextdocument.write("<br>=<br>")for i=0 to 2for j=0 to

2document.write(" " & m3(i,j))nextdocument.write("<br>")nextend

sub</script><body onLoad="matmul()"></body>



3 . Write a program that accepts a number from the user and displays

its factorialonly if it is a prime number.<html><head></head><script

language="VBScript">sub ChkPrime(n)dim i,prime,k  prime=truefor i=2 to

cint(n)/2if (n Mod i)=0 thenprime=falseend if nextif prime=true

thenfact(n)elsedocument.write("<br>The Number is Not Prime")end if end

subsub fact(n)dim f,if=1i=1do while(i<=cint(n))f=cint(f)*cint(i)i=i

+1loopdocument.write("<br>Factorial Of " & n & " is " & f)end

sub</script><body><form name="form1" method="post" action=""><input

name="n" type="text" id="n"><input name="Button" type="button"

onClick="ChkPrime

(form1.n.value)"value="factorial"></form></body></html>



DreamweaverSESSION 11.Design a home page of your TLC.<!DOCTYPE HTML

PUBLIC "-//W3C//DTD HTML 4.01

Transitional//EN"><html><head><title>Untitled Document</title><meta

http-equiv="Content-Type" content="text/html; charset=iso-8859-

1"></head><body><table width="100%" border="1" cellpadding="0"><tr><td

bgcolor="#ccc123"><div align="center"><strong><font

size="6">IGNOUPROGRAM STUDY

CENTER</font></strong></div></td></tr><tr><td bgcolor="#cccc12"><div

align="center"><strong><font size="6">WELCOMETO

</font></strong></div></td></tr><tr><td bgcolor="pink"><div

align="center"><strong><br><font size="4"><a

href="faculty_coord.html">FACULTIES ANDCOORDINATORS</a><br><a

href="theory_b_schedule.html">THEORY BATCH SCHEDULES</a> <br><a

href="prac_b_schedule.html">PRACTICAL BATCH SCHEDULES</a><br><a

href="sem_detail.html">SEMESTER WISE LIST OF STUDENTS</a> <br><a

href="assignment.html">ASSIGNMENT AND VIVA-VOCE</a> <br><a

href="ask_y_question.htm">ASK YOUR QUESTION</a> <br><a

href="mail.htm">MAIL US</a>

</font></strong><fontsize="4"></font></div></td></tr></table><p

align="center"><br></p></body></html>



2.Design a Home Page for a toy Company. The page has an image as th

background. Do some text attracting format.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01

Transitional//EN"><html><head><title>Toy Page</title><meta http-

equiv="Content-Type" content="text/html; charset=iso-8859-

1"></head><body background="646.jpg"><table width="100%" border="0"

cellpadding="0"><tr><td><div align="center"><strong><font

color="#33FF00" size="7">Tom

ToysCenter</font></strong></div></td></tr><tr><td>&nbsp;</td></tr><tr>

<td align="left" valign="top"><table width="100%"

border="1"cellpadding="0"><tr><td width="27%"><table width="100%"

border="1" cellpadding="0"><tr><td><div align="center"><font

size="5"><strong><ahref="prof.htm">Profiles</a></strong></font></div><

/td></tr><tr><td><div align="center"><font

size="5"><strong><ahref="Toys.htm">Toys</a></strong></font></div></td>

</tr><tr><td><div align="center"><font

size="5"><strong><ahref="cont.htm">ContactUs</a></strong></font></div>

</td></tr></table></td><td width="73%" align="left" valign="top"><div

align="justify"><fontcolor="#FFFFFF" size="4">We are one of the

leading toy comapny in the city and have branchesin all major

districts thoughout kerala. Our toy Shope containsa vide variety of

collection of toys which taste the choice of your kids. toys posses a

high quality . the toys are normally importedfrom European and

American

Countries.</font></div></td></tr></table></td></tr><tr><td>&nbsp;</td>

</tr></table></body></html>



3.Insert a image in your page and give a zig zag motion to the image

in you page(using timeline).<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML

4.01 Transitional//EN"><html><head><title>Untitled

Document</title><meta http-equiv="Content-Type" content="text/html;

charset=iso-8859-1"><script language="JavaScript"

type="text/JavaScript"><!--function MM_timelinePlay(tmLnName, myID) {

//v1.2//Copyright 1997, 2000 Macromedia, Inc. All rights reserved.var

i,j,tmLn,props,keyFrm,sprite,numKeyFr,firstKeyFr,propNum,theObj,firstT

ime=false;if (document.MM_Time == null) MM_initTimelines(); //if

*very* 1st timetmLn = document.MM_Time[tmLnName];if (myID == null) {

myID = ++tmLn.ID; firstTime=true;}//if new call, incr IDif (myID ==

tmLn.ID) { //if Im newestsetTimeout('MM_timelinePlay("'+tmLnName

+'",'+myID+')',tmLn.delay);fNew = ++tmLn.curFrame;for (i=0;

i<tmLn.length; i++) {sprite = tmLn[i];if (sprite.charAt(0) == 's') {if

(sprite.obj) {numKeyFr = sprite.keyFrames.length; firstKeyFr =

sprite.keyFrames[0];if (fNew >= firstKeyFr && fNew <=

sprite.keyFrames[numKeyFr-1]) {//inrangekeyFrm=1;for (j=0;

j<sprite.values.length; j++) {props = sprite.values[j];if (numKeyFr !=

props.length) {if (props.prop2 == null) sprite.obj[props.prop] =

props[fNew-firstKeyFr];else sprite.obj[props.prop2][props.prop] =

props[fNew-firstKeyFr];} else {while (keyFrm<numKeyFr &&

fNew>=sprite.keyFrames[keyFrm])keyFrm++;if (firstTime ||

fNew==sprite.keyFrames[keyFrm-1]) {if (props.prop2 == null)

sprite.obj[props.prop] = props[keyFrm-1];else sprite.obj[props.prop2]

[props.prop] = props[keyFrm-1];} } } } }} else if (sprite.charAt(0)

=='b' && fNew == sprite.frame) eval(sprite.value);if (fNew >

tmLn.lastFrame) tmLn.ID = 0;} }}function MM_initTimelines() {

//v4.0//MM_initTimelines() Copyright 1997 Macromedia, Inc. All rights

reserved.var ns = navigator.appName == "Netscape";var ns4 = (ns &&

parseInt(navigator.appVersion) == 4);var ns5 = (ns && parseInt

(navigator.appVersion) > 4);document.MM_Time = new Array

(1);document.MM_Time[0] = new Array(3);document.MM_Time["Timeline1"] =

document.MM_Time[0];document.MM_Time[0].MM_Name =

"Timeline1";document.MM_Time[0].fps = 15;document.MM_Time[0][0] = new

String("sprite");document.MM_Time[0][0].slot = 1;if (ns4)

document.MM_Time[0][0].obj = document["Layer1"];else if (ns5)

document.MM_Time[0][0].obj = document.getElementById

("Layer1");elsedocument.MM_Time[0][0].obj = document.all ?

document.all["Layer1"] :null;document.MM_Time[0][0].keyFrames = new

Array(1, 15);document.MM_Time[0][0].values = new Array(2);if (ns5)

document.MM_Time[0][0].values[0] = new Array("21px", "24px",

"28px","31px", "35px", "38px", "42px", "45px", "48px", "52px", "55px",

"59px", "62px","66px", "69px");elsedocument.MM_Time[0][0].values[0] =

newArray

(21,24,28,31,35,38,42,45,48,52,55,59,62,66,69);document.MM_Time[0]

[0].values[0].prop = "left";if (ns5)document.MM_Time[0][0].values[1] =

new Array("16px", "21px", "25px","30px", "35px", "39px", "44px",

"48px", "53px", "58px", "62px", "67px", "72px","76px", "81px");else

document.MM_Time[0][0].values[1] = newArray

(16,21,25,30,35,39,44,48,53,58,62,67,72,76,81);document.MM_Time[0]

[0].values[1].prop = "top";if (!ns4) {document.MM_Time[0][0].values

[0].prop2 = "style";document.MM_Time[0][0].values[1].prop2 =

"style";}document.MM_Time[0][1] = new String

("sprite");document.MM_Time[0][1].slot = 1;if (ns4)document.MM_Time

[0][1].obj = document["Layer1"];else if (ns5)document.MM_Time[0]

[1].obj = document.getElementById("Layer1");elsedocument.MM_Time[0]

[1].obj = document.all ? document.all["Layer1"]

:null;document.MM_Time[0][1].keyFrames = new Array(16,

30);document.MM_Time[0][1].values = new Array(2);if (ns5)

document.MM_Time[0][1].values[0] = new Array("69px", "77px",

"85px","93px", "102px", "110px", "118px", "126px", "134px", "142px",

"150px","159px", "167px", "175px", "183px"); elsedocument.MM_Time[0]

[1].values[0] = newArray

(69,77,85,93,102,110,118,126,134,142,150,159,167,175,183);document.MM_

Time[0][1].values[0].prop = "left"; if (ns5)document.MM_Time[0]

[1].values[1] = new Array("81px", "77px", "72px","68px", "63px",

"59px", "54px", "50px", "45px", "41px", "36px", "32px", "27px","22px",

"18px");elsedocument.MM_Time[0][1].values[1] = newArray

(81,77,72,68,63,59,54,50,45,41,36,32,27,22,18);document.MM_Time[0]

[1].values[1].prop = "top";if (!ns4) {document.MM_Time[0][1].values

[0].prop2 = "style";document.MM_Time[0][1].values[1].prop2 =

"style";}document.MM_Time[0][2] = new String

("sprite");document.MM_Time[0][2].slot = 1;if (ns4)document.MM_Time

[0][2].obj = document["Layer1"];else if (ns5)document.MM_Time[0]

[2].obj = document.getElementById("Layer1");elsedocument.MM_Time[0]

[2].obj = document.all ? document.all["Layer1"]

:null;document.MM_Time[0][2].keyFrames = new Array(31,

45);document.MM_Time[0][2].values = new Array(2);if (ns5)

document.MM_Time[0][2].values[0] = new Array("183px", "191px","198px",

"206px", "213px", "221px", "228px", "236px", "243px", "251px","258px",

"266px", "273px", "281px", "288px"); elsedocument.MM_Time[0]

[2].values[0] = newArray

(183,191,198,206,213,221,228,236,243,251,258,266,273,281,288);document

.MM_Time[0][2].values[0].prop = "left";if (ns5)document.MM_Time[0]

[2].values[1] = new Array("18px", "23px", "28px","32px", "37px",

"42px", "47px", "51px", "56px", "61px", "66px", "71px", "75px","80px",

"85px");elsedocument.MM_Time[0][2].values[1] = newArray

(18,23,28,32,37,42,47,51,56,61,66,71,75,80,85);document.MM_Time[0]

[2].values[1].prop = "top";if (!ns4) {document.MM_Time[0][2].values

[0].prop2 = "style";document.MM_Time[0][2].values[1].prop2 =

"style";}document.MM_Time[0].lastFrame = 45;for (i=0;

i<document.MM_Time.length; i++) {document.MM_Time[i].ID =

null;document.MM_Time[i].curFrame = 0;document.MM_Time[i].delay =

1000/document.MM_Time[i].fps;}}//--></script></head><body

onLoad="MM_timelinePlay('Timeline1')"><div id="Layer1"

style="position:absolute; left:21px; top:16px;

width:192px;height:147px; z-index:1"><img src="1Tourism1.jpg"

name="Image1"width="196" height="141"></div></body></html>



SESSION 41 . Design a form as follows.<!DOCTYPE HTML PUBLIC

"-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><title>Untitled

Document</title><meta http-equiv="Content-Type" content="text/html;

charset=iso-8859-1"></head><body><form name="form1"><table

width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td

width="23%">Your name</td><td width="77%"><input type="text"

name="textfield"></td></tr><tr><td>Yi\our Address</td><td><input

type="text" name="textfield2"></td></tr><tr><td>&nbsp;</td><td><input

type="text" name="textfield3"></td></tr><tr><td>Your

Gender</td><td><input type="radio" name="radiobutton"

value="radiobutton">Male<input type="radio" name="radiobutton"

value="radiobutton">Female </td></tr><tr><td>Your

Country</td><td><select name="select"

size="1"><option>India</option><option>America</option><option>Canada<

/option><option>Denmark</option><option>Egypt</option><option>France</

option><option>Germany</option><option>Hungry</option></select></td></

tr><tr><td>Your

Opinion</td><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td><textarea

name="textarea"

cols="50"></textarea></td></tr><tr><td>&nbsp;</td><td><input

type="reset" name="Reset" value="Reset"><input type="submit"

name="Submit2" value="Submit"></td></tr></table></form></body></html>




SESSION 21 . Insert an image in a page. In the browser, when you take

cursor over it, another image emerges under it and when you click on

the second image, it takes you toexercise 2 of session 1.<!DOCTYPE

HTML PUBLIC "-//W3C//DTD HTML 4.01

Transitional//EN"><html><head><title>Untitled Document</title><meta

http-equiv="Content-Type" content="text/html; charset=iso-8859-

1"><script language="JavaScript" type="text/JavaScript"><!--function

MM_swapImgRestore() { //v3.0var i,x,a=document.MM_sr; for

(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)x.src=x.oSrc;} function

MM_preloadImages() { //v3.0var d=document; if(d.images){ if(!d.MM_p)

d.MM_p=new Array();var i,j=d.MM_p.length,a=MM_preloadImages.arguments;

for(i=0; i<a.length; i++)if (a[i].indexOf("#")!=0){ d.MM_p[j]=new

Image; d.MM_p[j++].src=a[i];}}}function MM_findObj(n, d) { //v4.01var

p,i,x; if(!d) d=document; if((p=n.indexOf("?"))

>0&&parent.frames.length) {d=parent.frames[n.substring(p+1)].document;

n=n.substring(0,p);}if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!

x&&i<d.forms.length;i++) x=d.forms[i][n];for(i=0;!

x&&d.layers&&i<d.layers.length;i++)x=MM_findObj(n,d.layers

[i].document);if(!x && d.getElementById) x=d.getElementById(n); return

x;}function MM_swapImage() { //v3.0var

i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array;for(i=0;i<

(a.length-2);i+=3)if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]

=x; if(!x.oSrc)x.oSrc=x.src; x.src=a[i+2];}}//--></script></head><body

onLoad="MM_preloadImages('animals7.JPG')"><a href="ex1session2.htm"

onMouseOut="MM_swapImgRestore()"onMouseOver="MM_swapImage

('Image1','','animals7.JPG',1)"><img src="12.jpg"name="Image1"

width="218" height="140" border="0"></a></body></html>

































1.3 Java ScriptSession
14.How would you write any statement using only one write or writeln()

command?<html><head></head><script language="JavaScript">function

newpages(){document.writeln("Hi ");document.write("Welcome To My

Website");}</script><body><form name="form1" method="post" action="">

<p><input type="submit" name="Submit" value="Enter" onClick="newpages

()"></p></form></body></html>


5.Embed java script in html document asking user name and then

printing Hello<user Name>

<html><head></head><script language="JavaScript">function newpages

(txt){document.writeln("Hello " + txt);}</script><body><form

name="form1" method="post" action=""><p>Enter User Name<input

name="t1" type="text" id="t1"></p><p><input type="submit"

name="Submit" value="Enter"onClick="newpages

(form1.t1.value)"></p></form></body></html>



6.Create a dialogue box with “Welcome to my website” message.
<html><head></head><script language="JavaScript">alert("Welcome to my

website");</script><body></body></html>

=================================
Session 2
1.Evaluate the expressiona.
Ans. 7+5b. “7”+”5”c. 7*5d. 7/5e.7%5<html><head></head><script

language="JavaScript">function Calculate(choice){var result;switch

(choice)
{case 1:result=7+5; break;case 2:result="7" + "5"; break;case

3:result=7*5; break;case 4:result=7/5; break;case 5:result=7%5;

break;}document.writeln(result);}</script><body><form name="form1"

method="post" action=""> <p>Evaluate The

Expression</p><p><label><input type="radio" name="RadioGroup1"

value="radio"onClick="Calculate(1)">7+5</label><br><label><input

type="radio" name="RadioGroup1" value="radio"onClick="Calculate

(2)">"7" + "5"</label>
<br><label><input type="radio" name="RadioGroup1"

value="radio"onClick="Calculate(3)">7*5</label><br><label><input

type="radio" name="RadioGroup1" value="radio"onClick="Calculate

(4)">7/5</label><br><label><input type="radio" name="RadioGroup1"

value="radio"onClick="Calculate

(5)">7%5</label><br></p></form></body></html>



2. Write the segment of script that would ask the user if he wants a

greetingmessage and if he does, display a gif file called Welcome. gif

and display“Welcome to Netscape navigator!” in the document window

following the gif.<html><head></head><script

language="JavaScript">function messages(){input_box=confirm("Do You

Want a Greeting");if(input_box==true){window.open

("welcome.jpg");window.document.write("Welcome to Netscape navigator!"

);}else{alert("You Have Selected No");}}</script><body><form

name="form1" method="post" action=""><input type="submit"

name="Submit" value="Submit" onClick="messages

()"></form></body></html>



3.Write the object definition for an object called car with four

properties model,make, year and price.
<html><head><script language="JavaScript">var car=new

Object;car.model="Marcides

Benz";car.year=2008;car.make="DX";car.price=4500000;</script></head><s

cript language="JavaScript">function printdet(){document.write(" Model

: " + car.model);document.write(", Make : " +

car.make);document.write(", Year : " + car.year);document.write(",

Price : " +car.price);}</script><body><form name="form1" method="post"

action=""><input type="submit" name="Submit" value="Print Details"

onClick="printdet()"></form></body></html>



1.Write a program to display a multiplication

table.<html><head></head><script language="JavaScript">function

multable(){var num=prompt("Enter The No");var i;for(i=0;i<=10;i++)

{document.write(num + " * " + i + " = " + num*i +"<br>");}}

</script><body><form name="form1" method="post" action=""><input

type="submit" name="Submit" value="Print Details"onClick="multable

()"></form></body></html>



2.Write code to create a scrolling text.<html><head></head><script

language="JavaScript">function movetext(){if(txt.style.posLeft<720)

{txt.style.posLeft=txt.style.posLeft+2;window.setTimeout("movetext

()",5);}else{txt.style.posLeft=0;window.setTimeout("movetext()",5);}}

</script><body onLoad="movetext()"><form name="form1" method="post"

action=""><div id="txt"

style="position:relative;top:3;left0"><h2>Scrolling

Text</h2></div></form></body></html>


Session 42. Write a program to change color of text

randomly<html><head><script language="JavaScript">var colors=new

Array(6);colors[0]="#0000FF"; colors[1]="#FF0000"; colors[2]

="#006600";colors[3]="#FFCC00";colors[4]="#00FFFF"; colors[5]

="#000000";var i=1;</script></head><script

language="JavaScript">function changecolor(){ document.fgColor=colors

[i];i++;if(i>5)i=0;setTimeout("changecolor()",100);}</script><body

onLoad="changecolor()"><div align="center"><strong><font

size="7">Hello </font></strong> </div></body></html>


3.Create a web page using two image files, which switch b/w on another

as themouse pointer moves over the image. Use on mouse over and on

mouse out eventhandler.<html><head><script

language="JavaScript">function MM_swapImgRestore() {var

i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)

x.src=x.oSrc;}function MM_preloadImages() {var d=document; if

(d.images){ if(!d.MM_p) d.MM_p=new Array();var

i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length;i

++)if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a

[i];}}}function MM_findObj(n, d) {var p,i,x; if(!d) d=document; if

((p=n.indexOf("?"))>0&&parent.frames.length) {d=parent.frames

[n.substring(p+1)].document; n=n.substring(0,p);}if(!(x=d[n])&&d.all)

x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++)x=d.forms[i][n];for

(i=0;!x&&d.layers&&i<d.layers.length;i++)x=MM_findObj(n,d.layers

[i].document);if(!x && d.getElementById) x=d.getElementById(n); return

x;}function MM_swapImage() {var i,j=0,x,a=MM_swapImage.arguments;

document.MM_sr=new Array;for(i=0;i<(a.length-2);i+=3)if

((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc)

x.oSrc=x.src; x.src=a[i+2];}}</script></head><body

onLoad="MM_preloadImages('welcome.JPG')"><a href="#"

onMouseOut="MM_swapImgRestore()"onMouseOver="MM_swapImage

('Image1','','welcome.JPG',1)"><imgsrc="Img1.jpg" name="Image1"

width="261" height="195" border="0"></a></body></html>


Session 52 . Use the date function get & set date to prompt the user

for an integer b/w 1-31 &return day of the week it

represents.<html><head></head><script language="JavaScript">function

setdate(){var dt=new Date();dt=new Date

(form1.y.value,form1.m.value,form1.d.value);form1.gt.value=dt.getDate

() + "/" + dt.getMonth() + "/" +dt.getFullYear();}</script><body><form

name="form1" method="post" action=""><p>Day <input name="d"

type="text" id="d" size="3">Month <input name="m" type="text" id="m"

size="3">Year <input name="y" type="text" id="y" size="4"><input

type="button" name="Button" value="SetDate" onClick="setdate

()"></p><p> Date <input name="gt" type="text" id="gt">

</p></form></body></html>


2.Display time and print the message accordingly e.g Good morning in

morning etc.<html><head><script language="JavaScript">var dt=new Date

();document.write("Good Morning The Time Is : " + dt.getHours() +":" +

dt.getMinutes() + ":" + dt.getSeconds

());</script></head><body></body></html>


Session 61.Using java script create a digital

clock.<html><head></head><script language="JavaScript">function

getTimes(){var dt=new Date();form1.t.value= dt.getHours() + ":" +

dt.getMinutes() + ":" + dt.getSeconds();window.setTimeout("getTimes

()",1000);}</script><body onLoad="getTimes()"><form name="form1"

method="post" action=""><input name="t" type="text"

id="t"></form></body></html>


Session 71.Using java script create a

calculator.<html><head></head><script language="JavaScript">function

calc(ch){if(ch=="=")form1.t.value= eval(form1.t.value);elseif

(ch=="C")form1.t.value= "";elseform1.t.value+=ch;}</script><body

onLoad="getTimes()"><form name="form1" method="post" action=""><input

name="t" type="text" id="t"><br><input type="button" name="Button"

value="7" onClick="calc('7')"><input type="button" name="Submit2"

value="8" onClick="calc('8')"><input type="button" name="Submit3"

value="9" onClick="calc('9')"> <input type="button" name="Submit4"

value="+" onClick="calc('+')"><br><input type="button" name="Submit5"

value="4" onClick="calc('4')"><input type="button" name="Submit6"

value="5" onClick="calc('5')"><input type="button" name="Submit7"

value="6" onClick="calc('6')"><input type="button" name="Submit8"

value="-" onClick="calc('-')"><br><input type="button" name="Submit9"

value="1" onClick="calc('1')"><input type="button" name="Submit10"

value="2" onClick="calc('2')"><input type="button" name="Submit11"

value="3" onClick="calc('3')"><input type="button" name="Submit12"

value="*" onClick="calc('*')"><br><input type="button" name="Submit13"

value="0" onClick="calc('0')"><input type="button" name="Submit14"

value="C" onClick="calc('C')"><input type="button" name="Submit15"

value="=" onClick="calc('=')"><br></form></body></html>


Session 81.Create a web page with a textbox and check for validation.

If empty displaymessage and set focus to it, if filled display thank

you.<html><head></head><script language="JavaScript">function check()

{if(form1.t.value==""){alert("Enter The Text");form1.t.focus();}else

{alert("Thank You");}}</script><body><form name="form1" method="post"

action="">Enter a Text<input name="t" type="text" id="t"><input

type="submit" name="Submit" value="Submit" onClick="check

()"></form></body></html>


Session 111. Create a program to generate a hit counter

<html><head></head><script language="JavaScript">var

counter;counter=0;function count(){counter++;alert("Counter : " +

counter);}</script><body><form name="form1" method="post"

action=""><div align="center"><input type="button" name="Button"

value="Hit Me" onClick="count()"></div></form></body></html>


2.Create a program to check email address provided by the user is

valid or invalid.<html><head></head><script

language="JavaScript">function check(){if(form1.t.value==""){alert

("Enter The Text");form1.t.focus();}else{var

email,a,d,diff,k,c;email=form1.t.value;a=email.indexOf

('@');d=email.indexOf('.');diff=parseInt(d)-parseInt(a);k=parseInt

(d)+1;c=email.charAt(k);if(a<1||diff<=1||c==""){alert("Invalid Email

ID");form1.t.focus();}}}</script><body><form name="form1"

method="post" action="">Enter Email ID <input name="t" type="text"

id="t"><input type="submit" name="Submit" value="Submit"

onClick="check()"></form></body></html>


Session 121.Write a program to scroll the text on status

bar.<html><head></head><html><head></head><script

language="JavaScript">var ar="Scrolling Text";var space="";var

i;i=1;function count(){var cont,k=0;cont="";while(k<=i){cont=cont + "

";k++;}status=cont +ar;i++;if(i>100)i=0;window.setTimeout("count

()",5);}</script><body onLoad="count

()"></body></html><body></body></html>



2. Write a program to create a small window in a main

window.<html><head><script language="JavaScript">window.open

("newwindow.html");</script></head><body></body></html>


Session 151.Use java script for authentication and verification of the

text boxes in the staticsite developed by the student in the html

exercise.<html><head></head><script language="JavaScript">function

check(){if(form1.t.value==""){alert("Enter The

Username");form1.t.focus();}else if(form1.t2.value==""){alert("Enter

The Password");form1.t2.focus();}else{if((form1.t.value!="")||

(form1.t2.value!=”")){alert("Invalid Username or Password");}}}

</script><body><form name="form1" method="post" action=""><p>User Name

<input name="t" type="text" id="t"> </p><p>Password <input name="t2"

type="password" id="t2"> </p><p> <input type="button" name="Button"

value="Button" onClick="check()"></p></form></body></html>


a.VB ScriptSession 11.Write a program to display the following on a

web pageHello <User Name><html><head></head><script

language="VBScript">sub newpages(txt)document.writeln("Hello " + txt)

end sub</script><body><form name="form1" method="post"

action=""><p>Enter User Name<input name="t1" type="text"

id="t1"></p><p><input type="submit" name="Submit"

value="Enter"onClick="newpages

(form1.t1.value)"></p></form></body></html>

2.Create a web page that display a message box with the

message“welcome to my web site”<html><head></head><script

language="VBScript">sub msgs()msgbox("Welcome To My Web Site")end

sub</script><body><form name="form1" method="post" action=""><p>

<input type="submit" name="Submit" value="Message"onClick="msgs()">

</p></form></body></html>



3.Write code to change color of text

randomly.<html><head></head><script language="VBScript">dim colors(5)

colors(0)="#0000FF"colors(1)="#FF0000"colors(2)="#006600"colors(3)

="#FFCC00"colors(4)="#00FFFF"colors(5)="#000000"dim ii=0sub

changecolor()msgbox("Welcome To My Web Site")document.fgColor=colors

(i)i=i+1if(i>5) theni=0end if window.setTimeout("changecolor()",100)

end sub</script><body onLoad="changecolor()"><div

align="center"><strong><font size="7">Hello </font></strong>

</div></body></html>


Session 21.Write a VB Script code that accepts the length, breadth and

height and display thearea of a rectangle.<html><head></head><script

language="VBScript">sub area()dim l,b,h,ar 40 
l=form1.l.value b=form1.b.valueh=form1.h.valuear=l*b*hmsgbox("Area " &

ar)end sub</script><body onLoad="changecolor()"><form name="form1"

method="post" action="">Length <input name="l" type="text"

id="l">Breadth <input name="b" type="text" id="b">Height <input

name="h" type="text" id="h"><br><input type="button" name="Button"

value="Area" onClick="area()"></form></body></html>


2.Create a programme to generate a hit counter

<html><head></head><script language="VBScript">dim counter

counter=0sub count()counter=counter+1msgbox("Counter : " & counter)end

sub</script><body><form name="form1" method="post" action=""><div

align="center"><input type="button" name="Button" value="Hit Me"

onClick="count()"></div></form></body></html>


Session 31.Using vbscript create a calculator

<html><head></head><script language="VBScript">sub calc(ch)if(ch="=")

then form1.t.value= eval(form1.t.value)elseif(ch="C")

thenform1.t.value= ""elseform1.t.value=form1.t.value & chend if end if

end sub</script><body onLoad="getTimes()"><form name="form1"

method="post" action=""><input name="t" type="text" id="t"><br><input

type="button" name="Button" value="7" onClick="calc('7')"><input

type="button" name="Submit2" value="8" onClick="calc('8')"><input

type="button" name="Submit3" value="9" onClick="calc('9')"><input

type="button" name="Submit4" value="+" onClick="calc('+')"><br><input

type="button" name="Submit5" value="4" onClick="calc('4')"><input

type="button" name="Submit6" value="5" onClick="calc('5')"><input

type="button" name="Submit7" value="6" onClick="calc('6')"><input

type="button" name="Submit8" value="-" onClick="calc('-')"><br><input

type="button" name="Submit9" value="1" onClick="calc('1')"><input

type="button" name="Submit10" value="2" onClick="calc('2')"><input

type="button" name="Submit11" value="3" onClick="calc('3')"><input

type="button" name="Submit12" value="*" onClick="calc('*')"><br><input

type="button" name="Submit13" value="0" onClick="calc('0')"><input

type="button" name="Submit14" value="C" onClick="calc('C')"><input

type="button" name="Submit15" value="=" onClick="calc

('=')"><br></form></body></html>


Session 41.Create a programme to check for null or empty

string<html><head></head><script language="VBScript">sub check()if

(form1.t.value="")thenmsgbox("Enter The Text")form1.t.focus()

elsealert("Thank You")end if end sub</script><body><form name="form1"

method="post" action="">Enter a Text<input name="t" type="text"

id="t"><input type="submit" name="Submit" value="Submit"

onClick="check()"></form></body></html>


2.Create a form that has e-mail field. Now Write VB Script code for

Validation.<html><head></head><script language="VBScript">sub check()

if(form1.t.value="")thenalert("Enter The Text")form1.t.focus()elsedim

email,a,d,diff,k,cemail=form1.t.valuea=InStr(1,email,"@")d=InStr

(1,email,".")diff=d-ak=d+1c=Mid(email, k, 1)if(a<1 or diff<=1 or

c="")thenalert("Invalid Email ID")form1.t.focus()end if end if end

sub</script><body><form name="form1" method="post" action="">Enter

Email ID <input name="t" type="text" id="t"><input type="submit"

name="Submit" value="Submit" onClick="check()"></form></body></html>



Session 51.List Mouse and Key events in vbscriptMouse Events :

MouseOver, MouseOutKey Events : KeyUp,KeyDown,KeyRelease,

KeyPress2.How do you create random numbers in vbscript?Random No is

Generated byRndFunction



Session 61.Create a form in HTML containing the following files and

then perform thevalidation of each field using VBScript. Name-

textboxAddress-textboxDate Of Birth-Combo boxEmail-

textbox<html><head></head><script language="VBScript">sub check()if

(form1.n.value="")thenalert("Enter The Name")form1.n.focus()elseif

(form1.a.value="")thenalert("Enter The Address")form1.a.focus()elseif

(form1.y.value="")thenalert("Enter The Year")form1.y.focus()elseif

(form1.d.value="")thenalert("Select The Day")form1.d.focus()elseif

(form1.m.value="")thenalert("Select The Month")form1.m.focus()elseif

(form1.mail.value="")thendim

email,a,d,diff,k,cemail=form1.t.valuea=InStr(1,email,"@")d=InStr

(1,email,".")diff=d-ak=d+1c=Mid(email, k, 1)if(a<1 or diff<=1 or

c="")thenalert("Invalid Email ID")form1.t.focus()end if end if end

sub</script><body><form name="form1" method="post"

action=""><p>Name<input name="n" type="text" id="n"><br>Address<input

name="a" type="text" id="a"><br>Date Of Birth : Day<select name="d"

id="d"

><option>1</option><option>2</option><option>3</option><option>4</opti

on><option>5</option><option>6</option><option>7</option><option>8</op

tion><option>9</option><option>10</option>

<option>11</option><option>12</option><option>13</option><option>14</o

ption><option>15</option><option>16</option><option>17</option><option

>18</option><option>19</option><option>20</option>

<option>21</option><option>22</option><option>23</option><option>24</o

ption><option>25</option><option>26</option><option>27</option><option

>28</option><option>29</option><option>30</option><option>31</option><

/select>Month<select name="m"

id="m"><option>Jan</option><option>Feb</option><option>Mar</option><op

tion>Aprl</option><option>May</option><option>Jun</option><option>July

</option><option>Aug</option><option>Sep</option><option>Oct</option><

option>Nov</option><option>Dec</option></select>Year <input name="y"

type="text" id="y" size="6"><br>Email Id <input name="mail"

type="text" id="mail"><br> <input type="button" name="Button"

value="Button"onClick="check()"></form></body></html>


Session 8
1.Create a program the accepts the time from the system clock and

accordinglydisplays a Good morning, Good Afternoon and Good Evening

message to the user <html><head></head><script language="VBScript">sub

wish()dim hh=Datepart("h",Now)if h>=1 and h<=12 thenmsgbox("Good

Morning")elseif h>=13 and h<=18 thenmsgbox("Good Afternoon")

elsemsgbox("Good Evening")end if end sub</script><body onLoad="wish

()"></body></html>


Session 91.Write a programme that uses For next Looping Statements to

create a FibonacciSeries.<html><head></head><script

language="VBScript">sub fib()dim a,b,ca=1 b=1document.write("First 10

Fibonacci Series<br>")document.write(a & "&nbsp;&nbsp;" & b &

"&nbsp;&nbsp;")for i=3 to 10c=cint(a)+cint(b)document.write(c &

"&nbsp;&nbsp;")a=b b=cnextend sub</script><body onLoad="fib

()"></body></html>


2.Using Do While display the factorial of a

number.<html><head></head><script language="VBScript">sub fact(n)dim

f,if=1i=1do while(i<=cint(n))f=cint(f)*cint(i)i=i+1loopdocument.write

("<br>Factorial Of " & n & " is " & f)end sub</script><body><form

name="form1" method="post" action=""><input name="n" type="text"

id="n"><input name="Button" type="button" onClick="fact

(form1.n.value)"value="Factorial"></form></body></html>

Session 101.Write a Program that displays the multiplication of two

matrices.<html><head></head><script language="VBScript">sub matmul()

dim m1(3,3),m2(3,3),m3(3,3),count,i,jcount=0msgbox("Enter First

matrix")for i=0 to 2for j=0 to 2m1(i,j)=inputbox("")nextnextmsgbox

("Enter Seconf matrix")for i=0 to 2for j=0 to 2m2(i,j)=inputbox("")

next nextdocument.write("<br>Product of two Matrix<br>")for i=0 to

2for j=0 to 2for k=0 to 2m3(i,j)=cint(m3(i,j))+cint(m1(i,k))* cint(m2

(k,j))nextnextnextfor i=0 to 2for j=0 to 2document.write(" " & m1

(i,j))nextdocument.write("<br>")nextdocument.write("<br>+<br>")for i=0

to 2for j=0 to 2document.write(" " & m2(i,j))nextdocument.write

("<br>")nextdocument.write("<br>=<br>")for i=0 to 2for j=0 to

2document.write(" " & m3(i,j))nextdocument.write("<br>")nextend

sub</script><body onLoad="matmul()"></body>



3 . Write a program that accepts a number from the user and displays

its factorialonly if it is a prime number.<html><head></head><script

language="VBScript">sub ChkPrime(n)dim i,prime,k  prime=truefor i=2 to

cint(n)/2if (n Mod i)=0 thenprime=falseend if nextif prime=true

thenfact(n)elsedocument.write("<br>The Number is Not Prime")end if end

subsub fact(n)dim f,if=1i=1do while(i<=cint(n))f=cint(f)*cint(i)i=i

+1loopdocument.write("<br>Factorial Of " & n & " is " & f)end

sub</script><body><form name="form1" method="post" action=""><input

name="n" type="text" id="n"><input name="Button" type="button"

onClick="ChkPrime

(form1.n.value)"value="factorial"></form></body></html>



DreamweaverSESSION 11.Design a home page of your TLC.<!DOCTYPE HTML

PUBLIC "-//W3C//DTD HTML 4.01

Transitional//EN"><html><head><title>Untitled Document</title><meta

http-equiv="Content-Type" content="text/html; charset=iso-8859-

1"></head><body><table width="100%" border="1" cellpadding="0"><tr><td

bgcolor="#ccc123"><div align="center"><strong><font

size="6">IGNOUPROGRAM STUDY

CENTER</font></strong></div></td></tr><tr><td bgcolor="#cccc12"><div

align="center"><strong><font size="6">WELCOMETO

</font></strong></div></td></tr><tr><td bgcolor="pink"><div

align="center"><strong><br><font size="4"><a

href="faculty_coord.html">FACULTIES ANDCOORDINATORS</a><br><a

href="theory_b_schedule.html">THEORY BATCH SCHEDULES</a> <br><a

href="prac_b_schedule.html">PRACTICAL BATCH SCHEDULES</a><br><a

href="sem_detail.html">SEMESTER WISE LIST OF STUDENTS</a> <br><a

href="assignment.html">ASSIGNMENT AND VIVA-VOCE</a> <br><a

href="ask_y_question.htm">ASK YOUR QUESTION</a> <br><a

href="mail.htm">MAIL US</a>

</font></strong><fontsize="4"></font></div></td></tr></table><p

align="center"><br></p></body></html>



2.Design a Home Page for a toy Company. The page has an image as th

background. Do some text attracting format.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01

Transitional//EN"><html><head><title>Toy Page</title><meta http-

equiv="Content-Type" content="text/html; charset=iso-8859-

1"></head><body background="646.jpg"><table width="100%" border="0"

cellpadding="0"><tr><td><div align="center"><strong><font

color="#33FF00" size="7">Tom

ToysCenter</font></strong></div></td></tr><tr><td>&nbsp;</td></tr><tr>

<td align="left" valign="top"><table width="100%"

border="1"cellpadding="0"><tr><td width="27%"><table width="100%"

border="1" cellpadding="0"><tr><td><div align="center"><font

size="5"><strong><ahref="prof.htm">Profiles</a></strong></font></div><

/td></tr><tr><td><div align="center"><font

size="5"><strong><ahref="Toys.htm">Toys</a></strong></font></div></td>

</tr><tr><td><div align="center"><font

size="5"><strong><ahref="cont.htm">ContactUs</a></strong></font></div>

</td></tr></table></td><td width="73%" align="left" valign="top"><div

align="justify"><fontcolor="#FFFFFF" size="4">We are one of the

leading toy comapny in the city and have branchesin all major

districts thoughout kerala. Our toy Shope containsa vide variety of

collection of toys which taste the choice of your kids. toys posses a

high quality . the toys are normally importedfrom European and

American

Countries.</font></div></td></tr></table></td></tr><tr><td>&nbsp;</td>

</tr></table></body></html>



3.Insert a image in your page and give a zig zag motion to the image

in you page(using timeline).<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML

4.01 Transitional//EN"><html><head><title>Untitled

Document</title><meta http-equiv="Content-Type" content="text/html;

charset=iso-8859-1"><script language="JavaScript"

type="text/JavaScript"><!--function MM_timelinePlay(tmLnName, myID) {

//v1.2//Copyright 1997, 2000 Macromedia, Inc. All rights reserved.var

i,j,tmLn,props,keyFrm,sprite,numKeyFr,firstKeyFr,propNum,theObj,firstT

ime=false;if (document.MM_Time == null) MM_initTimelines(); //if

*very* 1st timetmLn = document.MM_Time[tmLnName];if (myID == null) {

myID = ++tmLn.ID; firstTime=true;}//if new call, incr IDif (myID ==

tmLn.ID) { //if Im newestsetTimeout('MM_timelinePlay("'+tmLnName

+'",'+myID+')',tmLn.delay);fNew = ++tmLn.curFrame;for (i=0;

i<tmLn.length; i++) {sprite = tmLn[i];if (sprite.charAt(0) == 's') {if

(sprite.obj) {numKeyFr = sprite.keyFrames.length; firstKeyFr =

sprite.keyFrames[0];if (fNew >= firstKeyFr && fNew <=

sprite.keyFrames[numKeyFr-1]) {//inrangekeyFrm=1;for (j=0;

j<sprite.values.length; j++) {props = sprite.values[j];if (numKeyFr !=

props.length) {if (props.prop2 == null) sprite.obj[props.prop] =

props[fNew-firstKeyFr];else sprite.obj[props.prop2][props.prop] =

props[fNew-firstKeyFr];} else {while (keyFrm<numKeyFr &&

fNew>=sprite.keyFrames[keyFrm])keyFrm++;if (firstTime ||

fNew==sprite.keyFrames[keyFrm-1]) {if (props.prop2 == null)

sprite.obj[props.prop] = props[keyFrm-1];else sprite.obj[props.prop2]

[props.prop] = props[keyFrm-1];} } } } }} else if (sprite.charAt(0)

=='b' && fNew == sprite.frame) eval(sprite.value);if (fNew >

tmLn.lastFrame) tmLn.ID = 0;} }}function MM_initTimelines() {

//v4.0//MM_initTimelines() Copyright 1997 Macromedia, Inc. All rights

reserved.var ns = navigator.appName == "Netscape";var ns4 = (ns &&

parseInt(navigator.appVersion) == 4);var ns5 = (ns && parseInt

(navigator.appVersion) > 4);document.MM_Time = new Array

(1);document.MM_Time[0] = new Array(3);document.MM_Time["Timeline1"] =

document.MM_Time[0];document.MM_Time[0].MM_Name =

"Timeline1";document.MM_Time[0].fps = 15;document.MM_Time[0][0] = new

String("sprite");document.MM_Time[0][0].slot = 1;if (ns4)

document.MM_Time[0][0].obj = document["Layer1"];else if (ns5)

document.MM_Time[0][0].obj = document.getElementById

("Layer1");elsedocument.MM_Time[0][0].obj = document.all ?

document.all["Layer1"] :null;document.MM_Time[0][0].keyFrames = new

Array(1, 15);document.MM_Time[0][0].values = new Array(2);if (ns5)

document.MM_Time[0][0].values[0] = new Array("21px", "24px",

"28px","31px", "35px", "38px", "42px", "45px", "48px", "52px", "55px",

"59px", "62px","66px", "69px");elsedocument.MM_Time[0][0].values[0] =

newArray

(21,24,28,31,35,38,42,45,48,52,55,59,62,66,69);document.MM_Time[0]

[0].values[0].prop = "left";if (ns5)document.MM_Time[0][0].values[1] =

new Array("16px", "21px", "25px","30px", "35px", "39px", "44px",

"48px", "53px", "58px", "62px", "67px", "72px","76px", "81px");else

document.MM_Time[0][0].values[1] = newArray

(16,21,25,30,35,39,44,48,53,58,62,67,72,76,81);document.MM_Time[0]

[0].values[1].prop = "top";if (!ns4) {document.MM_Time[0][0].values

[0].prop2 = "style";document.MM_Time[0][0].values[1].prop2 =

"style";}document.MM_Time[0][1] = new String

("sprite");document.MM_Time[0][1].slot = 1;if (ns4)document.MM_Time

[0][1].obj = document["Layer1"];else if (ns5)document.MM_Time[0]

[1].obj = document.getElementById("Layer1");elsedocument.MM_Time[0]

[1].obj = document.all ? document.all["Layer1"]

:null;document.MM_Time[0][1].keyFrames = new Array(16,

30);document.MM_Time[0][1].values = new Array(2);if (ns5)

document.MM_Time[0][1].values[0] = new Array("69px", "77px",

"85px","93px", "102px", "110px", "118px", "126px", "134px", "142px",

"150px","159px", "167px", "175px", "183px"); elsedocument.MM_Time[0]

[1].values[0] = newArray

(69,77,85,93,102,110,118,126,134,142,150,159,167,175,183);document.MM_

Time[0][1].values[0].prop = "left"; if (ns5)document.MM_Time[0]

[1].values[1] = new Array("81px", "77px", "72px","68px", "63px",

"59px", "54px", "50px", "45px", "41px", "36px", "32px", "27px","22px",

"18px");elsedocument.MM_Time[0][1].values[1] = newArray

(81,77,72,68,63,59,54,50,45,41,36,32,27,22,18);document.MM_Time[0]

[1].values[1].prop = "top";if (!ns4) {document.MM_Time[0][1].values

[0].prop2 = "style";document.MM_Time[0][1].values[1].prop2 =

"style";}document.MM_Time[0][2] = new String

("sprite");document.MM_Time[0][2].slot = 1;if (ns4)document.MM_Time

[0][2].obj = document["Layer1"];else if (ns5)document.MM_Time[0]

[2].obj = document.getElementById("Layer1");elsedocument.MM_Time[0]

[2].obj = document.all ? document.all["Layer1"]

:null;document.MM_Time[0][2].keyFrames = new Array(31,

45);document.MM_Time[0][2].values = new Array(2);if (ns5)

document.MM_Time[0][2].values[0] = new Array("183px", "191px","198px",

"206px", "213px", "221px", "228px", "236px", "243px", "251px","258px",

"266px", "273px", "281px", "288px"); elsedocument.MM_Time[0]

[2].values[0] = newArray

(183,191,198,206,213,221,228,236,243,251,258,266,273,281,288);document

.MM_Time[0][2].values[0].prop = "left";if (ns5)document.MM_Time[0]

[2].values[1] = new Array("18px", "23px", "28px","32px", "37px",

"42px", "47px", "51px", "56px", "61px", "66px", "71px", "75px","80px",

"85px");elsedocument.MM_Time[0][2].values[1] = newArray

(18,23,28,32,37,42,47,51,56,61,66,71,75,80,85);document.MM_Time[0]

[2].values[1].prop = "top";if (!ns4) {document.MM_Time[0][2].values

[0].prop2 = "style";document.MM_Time[0][2].values[1].prop2 =

"style";}document.MM_Time[0].lastFrame = 45;for (i=0;

i<document.MM_Time.length; i++) {document.MM_Time[i].ID =

null;document.MM_Time[i].curFrame = 0;document.MM_Time[i].delay =

1000/document.MM_Time[i].fps;}}//--></script></head><body

onLoad="MM_timelinePlay('Timeline1')"><div id="Layer1"

style="position:absolute; left:21px; top:16px;

width:192px;height:147px; z-index:1"><img src="1Tourism1.jpg"

name="Image1"width="196" height="141"></div></body></html>



SESSION 41 . Design a form as follows.<!DOCTYPE HTML PUBLIC

"-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><title>Untitled

Document</title><meta http-equiv="Content-Type" content="text/html;

charset=iso-8859-1"></head><body><form name="form1"><table

width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td

width="23%">Your name</td><td width="77%"><input type="text"

name="textfield"></td></tr><tr><td>Yi\our Address</td><td><input

type="text" name="textfield2"></td></tr><tr><td>&nbsp;</td><td><input

type="text" name="textfield3"></td></tr><tr><td>Your

Gender</td><td><input type="radio" name="radiobutton"

value="radiobutton">Male<input type="radio" name="radiobutton"

value="radiobutton">Female </td></tr><tr><td>Your

Country</td><td><select name="select"

size="1"><option>India</option><option>America</option><option>Canada<

/option><option>Denmark</option><option>Egypt</option><option>France</

option><option>Germany</option><option>Hungry</option></select></td></

tr><tr><td>Your

Opinion</td><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td><textarea

name="textarea"

cols="50"></textarea></td></tr><tr><td>&nbsp;</td><td><input

type="reset" name="Reset" value="Reset"><input type="submit"

name="Submit2" value="Submit"></td></tr></table></form></body></html>




SESSION 21 . Insert an image in a page. In the browser, when you take

cursor over it, another image emerges under it and when you click on

the second image, it takes you toexercise 2 of session 1.<!DOCTYPE

HTML PUBLIC "-//W3C//DTD HTML 4.01

Transitional//EN"><html><head><title>Untitled Document</title><meta

http-equiv="Content-Type" content="text/html; charset=iso-8859-

1"><script language="JavaScript" type="text/JavaScript"><!--function

MM_swapImgRestore() { //v3.0var i,x,a=document.MM_sr; for

(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)x.src=x.oSrc;} function

MM_preloadImages() { //v3.0var d=document; if(d.images){ if(!d.MM_p)

d.MM_p=new Array();var i,j=d.MM_p.length,a=MM_preloadImages.arguments;

for(i=0; i<a.length; i++)if (a[i].indexOf("#")!=0){ d.MM_p[j]=new

Image; d.MM_p[j++].src=a[i];}}}function MM_findObj(n, d) { //v4.01var

p,i,x; if(!d) d=document; if((p=n.indexOf("?"))

>0&&parent.frames.length) {d=parent.frames[n.substring(p+1)].document;

n=n.substring(0,p);}if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!

x&&i<d.forms.length;i++) x=d.forms[i][n];for(i=0;!

x&&d.layers&&i<d.layers.length;i++)x=MM_findObj(n,d.layers

[i].document);if(!x && d.getElementById) x=d.getElementById(n); return

x;}function MM_swapImage() { //v3.0var

i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array;for(i=0;i<

(a.length-2);i+=3)if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]

=x; if(!x.oSrc)x.oSrc=x.src; x.src=a[i+2];}}//--></script></head><body

onLoad="MM_preloadImages('animals7.JPG')"><a href="ex1session2.htm"

onMouseOut="MM_swapImgRestore()"onMouseOver="MM_swapImage

('Image1','','animals7.JPG',1)"><img src="12.jpg"name="Image1"

width="218" height="140" border="0"></a></body></html>


Wednesday, September 7, 2011

MCSL-016 INTERNET CONCEPTS AND WEB DESIGN, (SCRIPTING LANGUAGE), MCSL 016 INTERNET CONCEPTS AND WEB DESIGNING - SCRIPTING LANGUAGES; INDIRA GANDHI NATIONAL OPEN UNIVERSITY, IGNOU, FIRST SYMESTER, FIRST YEAR, (THE INTERNET, INTRODUCTION TO HTML, ADVANCE HTML, JAVA SCRIPT, VBSCRIPT, DREAMWEAVER);

MCSL-016 INTERNET CONCEPTS AND WEB DESIGN, IGNOU 2011 SYLLABUS;
(SCRIPTING LANGUAGE), MCSL 016 INTERNET CONCEPTS AND WEB DESIGNING - SCRIPTING LANGUAGES; INDIRA GANDHI NATIONAL OPEN UNIVERSITY, IGNOU, FIRST SYMESTER, FIRST YEAR, (THE INTERNET, INTRODUCTION TO HTML, ADVANCE HTML, JAVA SCRIPT, VBSCRIPT, DREAMWEAVER);
NOTE: These are my/our personal notes, for personal use, please follow your own books and syllabus, i/we are not responsible for any error/errors in these notes, thanks.
======================================================
COURSE INTRODUCTION : Internet is a hot topic today.  It has revolutionized the way we live,work, learn and communicate with each other. It has opened up new gateways of opportunities for education and helped increase productivity, as well efficiency in areas like healthcare banking, governance, and manufacturing all over the world.
As IT Professionals we have to deal with the whole range of Web Technologies starting from the Internet, i.e. to HTML, Advanced HTML, Java Script, VB Script, XML, COM, JSP, ASP, Dream Weaver, etc.  The purpose of the course is to introduce some of these technologies.  In the first Block of course, We study how to design specific page and dynamic web pages. We will also examine forma and frames, two of the most important features of the web pages. The second part of the course, We focus on the practical issues. Each topic is covered in the 10 practical sessions of three hours duration each.
======================================================
BLOCK INTRODUCTION
This block (MCSL016 - I.C.W.D. - SCRIPTING LANGUAGE) introduces three major topics namely, Internet, Scripting Languages, and HTML Editor. Internet has been discussed in the first unit and remaining four units focuses on Scripting Language and the last unit is about Dreamweaver, which is a HTML Editor. The block is organized as follows :
===============================================
Unit 1 : In this unit, lessons describe about the classification of Different Computer Network and then describes how does the Internet work? Unit/ Book also take up practical issues like : how to configure a browser, how to connect to Internet etc. Internet is based on two standard protocols TCP & IP, (OR WE CAN SAY INTERNET PROTOCOL SUIT) (OR DIFFERENT TYPE OF INTERNET PROTOCOLS) which has also been discussed in brief. At the end of this unit we describe different types of services provided by the Internet.
Unit 2 : This unit is about HTML, which is a Scripting Language. When we connect to a Web Site, the Web Server on on the remote computer presents our browser with a file in a special format. The contennts of the file are stored in a special format-usint HTML. The unit introduces a large number of tags.
Unit 3: Describes how to make interactive Web sites for which we require features like, frames, tables, and forms accepting user input.
Unit 4: In this unit we are going to learn about another Scripting Language, Java Script code and insert name into HTML documents and how to make the Web Page more dynamic and interactive.
Unit 5: This unit is about VBScript, a Microsoft Scripting Language. This is the last unit on Scripting Language, which is quite common. VB Script is a Microsoft Scripting Language. It enable us to write programs that enhance the power of Web Page by allwing to control their behaviour. It also discusses about objects in VBScript and talk about dictionary object as an example.
Unit 6: The last unit of this block is about HTML Editor, which is a tool for managing and creating a Web Site. At the end of this unit we discuss how to choose option, use inspectors and panels, and set preferences that best fit our work styles.

Reference : 1. The Internet By Douglas E. Comer.
2. Web Technologies by Achyut S Godbole and Atul Khate.
3. Data Communication & Networking by Bchrouz A. Forouzan.
4. Computer Networking by James F. Kurose, Keith, W. Ross, Pearson.
5. Computer Networking by A.S. Janenbaun, 4th Edition, PHI.
======================================================
UNIT-1 : THE INTERNET
======================================================
1.0 - Introduction
1.1 - Objectives
1.2 - Classification of Networks
1.3 - Networking Models
1.4 - What is Packet Switching ?
1.5 - Accessing the Internet
1.6 - Internet Protocols
----- 1.6.1 - Internet Protocol - IP
----- 1.6.2 - Transmission Control Protocol (TCP)
1.7 - Internet Address 
----- 1.7.1 - Structure of Internet Servers Address
----- 1.7.2 - Address Space
1.8 - How does the Internet Work ?
1.9 - Internet & Extranet 
1.10- Internet Infrastructure
1.11- Protocols and Services on Internet
----- 1.11.1 - Domain Name System
----- 1.11.2 - SMTP and Electronic Mail
----- 1.11.3 - HTTP and (WWW) World Wide Web
----- 1.11.4 - Usenet and News-groups
----- 1.11.5 - FTP
----- 1.11.6 - Telnet
1.12- Internet Tools
----- 1.12.1 - Search Engines
----- 1.12.2 - Web Browsers
1.13- Summary
1.14- Solutions / Answers
======================================================
1.0 INTRODUCTION
The Internet is worldwide computer network that interconnects, million of computing devices throughout the world. Most of these devices are PC's and servers that store and transmit information sucha as web pages and e-mail messages. Internet is revolutionizing the enhancing the way we as humans communicate, both locally and around the globe. Everyone wants to be a part of it because the Internet literally puts a world of information and a potential world-wide audience at your fingertips.
The Internet evolved from the ARPANET (Advanced Research Projects Agency) to which other networks where added to form an inter network, The present Internet is a collection of several hundred thousand of networks rather than a single network. From there evolved a high-speed backbone of Internet acces for sharing these of networks. The end of the decade saaw the emergance of the World Wide Web, which heralded a platform -independent means of communication enhanced with a pleasant and relatively easy-to-use Graphical Interface (GUI).
 
CLICK THE IMAGE TO ENLARGE --------------------
                                             ||
                                             \/
World Wide Web (or WWW) - is an example of an Information Protocol/ Service that can be used to send and receive information over the Internet. It supports:
  • Multimedia Information (text, movies, pictures, sound, programs... ).
  • Hyper Text Information (information that contains links to other information resources).
  • Graphic User Interface or GRAPHICAL USERE INTERFACE - GUI - (so users can point and click to request information instead of typing in text commands) like Mouse, Pointing Devices, Touch Pad, Video Inputs etc.
The World Wide Web model follows Client/ Server software design. A service that uses client/ server design requires two pieces of software to work: Client Software, which you use to request information, and Server Software, which is an Information Provider.
The server software for the World Wide Web is called an HTTP Server(or informally a web server). Examples are Mac HTTP, CERN HTTP (CERN IS European Organization for Nuclear Research), and NCSA HTTP   (NCSA = National Center for Supercomputing Applications), The client softwares for World Wide Web is called a Web Browsers (examples are : Internet Explorer, Mozilla Firefox, Netscape Nevigator, Opera, Chrome, etc.)
(NOTE: CERN FULL FORM - Conseil Européen pour la Recherche Nucléaire )
= = = = = = = = = = = = = = = = = = = = = = = = = =  = = = = = = = = = = = =
1.1 OBJECTIVES :
After going through this unit students / we - should be able to :
  • Make classification of Networks (variour Network Topologies);
  • Understand Two types of Networking Models OAI MODELS;
  • Understand the concept of Packet Switching;
  • Understand how to access to the Internet;
  • List the services available on Internet; and to
  • Understand how does the Internet or Intranet Works.
1.2 CLASSIFICATION OF NETWORKS :
There are different approaches to the classification of Computer Networks. One such classification is based on the distance approach. In this section we will discus such networks.
.
The networks can be classified into LAN, MAN and WAN networks. Here we desctibe them into brief to understand the different between the types of network.
.
Local Area Network (LAN) : LAN is a privatey - owned computer networks confined to small geographical area, such as an office or a factory Widely used to connect office PCs to share Information and Resourses (such as peripheral devices - printer, scanner, softwares, hardware etc..  In a Local Area Network - two or more computers are connected by same physical medium, such as a transmission cable. An important characteristic of Local Area netwoks is speed. i.e. they deliver the data very fast compared to other type of networks with ptypical data transmission speed are 10-100 Mbps (or in market we say 10/100 LAN Card).

A wide variety of LANs have been build and installed, but a few types have more rcently become dominant. The most widely used LAN system is the Ethernet System. Intermediate Nodes (i.e. repeaters, bridges, switches, routers, etc.) - allow LANs to be connected together to form large LANs. A LAN may also be connected to another LAN or to WANs and MANs using a "ROUTER".
SUMMARY OF LAN : ---
  1. LAN is a Communication Network (Home, School, Offices etc.).
  2. Useful in - One Building or Group of Buildings / Rooms etc.
  3. Controlled by one Administrator Authority.
  4. It is High Speed 10/100, and is always shared.
  5. We can share mostly all resourses by LAN.
  6. We can Control over other Desktop or Multiple Desktops through LAN.
  7. LAN is usefur for Building - other / Multiple and Big Networks.
  8. Networking is done by CAT Cables and RJ Connectors.
= = = = = = = = = = = = = = = = = = = =  = = = =  = = = = = = = = = =  = = = = =
A MAN, basically a bigger version of a LAN is designed to extend over an entire city. It may be single network such as a cable television network, or it may be a means of connecting a number of LANs into a large network so that resources may be shared for example, a company can use a MAN (Metropolitan Area Network) to connect the LANs in all of its office throughout a city.
A MAN typically covers an area of between 5 and 50 Km diameter. Many MANs cover an area the size of a city, although in some cases MANs may be as small as a group of Buildings.

The MAN, its communications links and equipment are generally owned by either a consortium (संघ) of users or by a single network provider who sells the service to the users. This level of service provided to each user must therefore be negotiated with the MAN operator, and some performance guarantees are normally specified.
A MAN often acts as a high-speed network to allow sharing of regional resources (similar to a large LAN). It is also frequently used to provide a shared connectio to other networks using a link to a WAN.
SUMMARY OF MAN : ---
  1. MAN - IS BIGGER VERSION OF - LAN; (OR MAN IS GROUP OF LAN)
  2. LIKE CABLE TV, AND INTER CITY NETWORKS;
  3. A COMPANY CAN JOIN ALL ITs OFFICE IN A CITY BY MAN;
  4. FROM 5 - 50 KILO METER -- TO -- ENTIRE CITY (REPEATERS AND ROUTERS ARE USED).
  5. MORE THEN ONE ADMINISTRATORS (NETWORK ADMINS.);
  6. SAME AS LAN - WE CAN SHARE RESOURCES IN - MAN;
  7. 34 - 155 Mbps.
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Wide Area Network (WAN) :
The term Wide Area Network (WAN) usually refers to a network, which covers a large geographical area, and use communication subnets (circuits) to connect the intermediate nodes.  A major factor impacting WAN design and performace is a requirement that they lease communication subset from telephone companies or other communication carriers.  Transmission rates are typically 2 Mbps, 34, Mbps, 155 Mbps, 625 Mbps (or sometimes considerably more).  the basic purpose of th subnet is to transmit message from one end to another end through intermediate nodes.

In most WAN a subnet consists of two types of elements: (i)Transmission Lines; (ii)Switching Element.
Transmission Lines - also called channels move about from one machine to another machine. The basic purpose of the switching element is to select the outgoing path for forwarding the message.
Numerous WANs have been constructed, including public switched networks, large corporate networks, military networks, banking networks, stock brokerage networks, and airline reservation networks. A WANis wholly owned and use ny a single comapny is oftern referred to as an enterprises network.
SUMMARY ABOUT WAN :
  1. WAN Covers - Large Geographical Area.
  2. They Lease communication subsets from Tel. Companies / Communication Carriers (Airtel, MTNL, BSNL, VSNL, Bharti Telecommunications etc.)
  3. Transmission Rate is - 2 Mbps, 34, Mbps, 155 Mbps, 625 Mbps or more (sometime 1 Gbps).
  4. WAN subnet consist of two types of Elements (1) Transmission Lines (2) Switching Elemennt.
  5. Transmission Lines are Channels from one Machine to another, WHILE - Switching Elements are path to Forwarding Messages.
  6. WAN used mostly in Large Companies, Military, Banking, Stock, Airline, Train, Govt. Offices.
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
1.3 NETWORKING MODELS (OSI & TCP/IP) - There are two types of Networking Models available: (1)OSI and (2) TCP/IP;
OSI (Open System Interconnection) Networking Model : An Open system is a model that allow any two different systems to communicate regardless of their underlying architecture. The purpose of teh OSI model is to open communication between different devices without requiring change to the logic of the underlying hardware and software.
The OSI model is not a protocol, it is a model of understanding and designing a network architecture that is inter- operable (अंतर - प्रचलित), Flexible and Robust (मजबूत).  The OSI model has a seven - lsyered architecture. These 7 LAYERS ARE :
  1. PHYSICAL LAYER - to send the Raw Bits between physical medium.
  2. DATA LINK LAYER - to transmit a group of bits between the adjacant (समीपवर्ती, nearby, निकटस्थ, संलग्न) nodes.
  3. NETWORK LAYER - responsible for routing a packet within the subnet that is, from source to destination nodes across multiple nodes in the same network or across multiple networks. (i.e. same subnet mask like 255.255.255.0 etc etc.)
  4. TRANSPORT LAYER - this is end to end layer, header of the transport layer contains information that helps send the message to the corresponding layer at the distination node.
  5. SESSION LAYER - responsible for establishing / maintaining and synchronizing the interaction between two communication hosts. 
  6. PRESENTATION LAYER - Data encryption / decryption / Compression / Translation etc.
  7. APPLICATION LAYER -  provides user interface for network applications such as remote login, WWW and FTP. responsible for file access / transfer, mail services, remote login, WWW.

NETWORK LAYERS IN DETAIL

:

  1. PHYSICAL LAYER : Responsible for sending raw bits between the source and destination nodes over a physical medium. The source and destination nodes have to agree on a number of factors.
    - SIGNAL ENCODING : how are the bits 0 and 1 to be represented ?
    - MEDIUM : type of medium used and its properties ?
    - BIT SYNCHRONIZATION (तुल्यकालन, समकालीन बनाने की क्रिया, समकालीकरण) : is the transmission synchronous or asynchronous (अतुल्यकालिक) ?
    - TRANSMISSION TYPE :
    - TRANSMISSION MODE :
    - TOPOLOGY :
    -
    -

    The physical layer defines electrical and physical specifications for devices. In particular, it defines the relationship between a device and a transmission medium, such as a copper or optical cable. This includes the layout of pins, voltages, cable specifications, hubs, repeaters, network adapters, host bus adapters (HBA used in storage area networks) and more.

OSI Model
Data unit
Layer
Function
Host
layers
Data
Network process to application
Data representation, encryption and decryption, convert machine dependent data to machine independent data
Interhost communication
Segments
End-to-end connections, reliability and flow control
Media
layers
Packet/Datagram
Path determination and logical addressing
Frame
Physical addressing
Bit
Media, signal and binary transmission