Web Programming Manual

Only available on StudyMode
  • Topic: Cascading Style Sheets, Perl, XHTML
  • Pages : 12 (1427 words )
  • Download(s) : 83
  • Published : February 22, 2013
Open Document
Text Preview
1.Develop and demonstrate a XHTML document that illustrates the use external style sheet, ordered list, table, borders, padding, color, and the tag.

p,table,li,// mystyle.css
{
font-family: "lucida calligraphy", arial, 'sans serif';
margin-left: 10pt;
}

p { word-spacing: 5px; }

body { background-color:rgb(200,255,205); }

p,li,td { font-size: 75%;}

td { padding: 0.5cm; }

th {
text-align:center;
font-size: 85%;
}

h1, h2, h3, hr {color:#483d8b;}

table
{
border-style: outset;
background-color: rgb(100,255,105);
}

li {list-style-type: lower-roman;}

span
{
color:blue;
background-color:pink;
font-size: 29pt;
font-style: italic;
font-weight: bold;
}

Lab program1

This header is 36 pt
This header is blue
This paragraph has a left margin of 50 pixels

Name
Email

Dr. HNS
hns@gmail.com

Dr. MKV
mkv@rediffmail.com

Dr. GTR
gtr@rnsit.in

Dr. MVS
mvs@hotmail.com

TSB Singh
Prakash S
manojKumar

This is a text. This is a text. This is a text. This is a text. This is a text. This is a text. This is a text. This is a text. This is a text. This is a text.

2.Develop and demonstrate a XHTML file that includes Javascript script for the following problems: a) Input: A number n obtained using prompt
Output: The first n Fibonacci numbers

var fib1=0,fib2=1,fib=0;
var num = prompt("Enter a number : \n", "");

if(num!=null && num>0)
{
document.write("" + num + " Fibonocci are ");
if(num==1)
document.write(" "+ fib1 + "");
else
document.write("" + fib1 + " " + fib2 + "");

for(i=3;i

function disp(str)
{
var alphaExp = /^[a-zA-Z]+$/;
if(!str.value.match(alphaExp))
{alert("Input should be only alphabets");
return false; }
sml=31;
text = str.value.toLowerCase();
var ia = text.indexOf("a");
if(sml > ia && ia >= 0)
{sml=ia;}
var ie = text.indexOf("e");
if(sml > ie && ie >= 0)
{sml=ie;}
var ii = text.indexOf("i");
if(sml > ii && ii >= 0)
{sml=ii;}
var io = text.indexOf("o");
if(sml > io && io >= 0)
{sml=io;}
var iu = text.indexOf("u");
if(sml > iu && iu >= 0)
{sml=iu;}
if(sml == 31)
alert("No vowel found");
else
alert("The leftmost position of the vowel is " + sml);
}

Enter a String :

3b) Parameter: A number
Output: The number with its digits in the reverse order.

function disp(num)
{
var alphaExp = /^[0-9]+$/;
if(!num.value.match(alphaExp))
{
alert("Input should be positive numeric");
return false;
}
var rn=0, n= Number(num.value);
while(n!=0)
{
r = n%10;
n = Math.floor(n/10);
rn = rn*10 + r;
}
alert("The " + num.value + " in reverse is " + rn);
}

Enter a number :

4.a) Develop and demonstrate, using Javascript script, a XHTML document that collects the USN ( the valid format is: A digit from 1 to 4 followed by two upper-case characters followed by two digits followed by two upper-case characters followed by three digits; no embedded spaces allowed) of the user. Event handler must be included for the form element that collects this information to validate the input. Messages in the alert windows must be produced when errors are detected.

function formValidator()
{
var usn = document.getElementById('req1');
alert(usn.value);
if(isCorrect(usn))
{
return true;
}
return false;
}
function isCorrect(elem1)
{
alphaExp1=/[1-4][A-Z][A-Z][0-9][0-9][A-Z][A-Z][0-9][0-9][0-9]$/ if(elem1.value.length == 0)
{
alert("US Number is empty");
elem1.focus();
return false;
}
else if(!elem1.value.match(alphaExp1))
{
alert("US...
tracking img