Professional Documents
Culture Documents
Internet Technologies6
Internet Technologies6
6
Data validation
Roll Number
After entering the name and 6 digit number/alphabet and press the submit button
function animate()
{
document.line_rotate.src = image_seq[number].src;
number ++;
if (number > 4) number = 1;
}
function slow()
{
delay = delay + 25;
if (delay > 2000) delay = 2000;
}
function fast()
{
delay = delay - 25;
if (delay < 0) delay = 0;
}
</SCRIPT>
<BODY>
<IMG NAME="line_rotate" SRC="1.gif" onLoad="setTimeout
('animate()', delay)" >
<FORM>
<INPUT TYPE="button" VALUE="Slow"
onClick="slow()" >
<INPUT TYPE="button" VALUE="Fast"
onClick="fast()" >
</FORM>
</BODY>
Slow Fast
Scrolling Text Message
<H2> Look at the status bar at the bottom of the page. You
will see a scrolling message </H2>
</BODY>
Look at the status bar at the bottom of the page. You will see
a scrolling message
History Back / Forward
<FORM>
<INPUT TYPE="button" VALUE="BACK"
onClick="history.back()">
<INPUT TYPE="button" VALUE="FORWARD"
onClick="history.forward()">
</FORM>
</BODY>
Browser Detection
•This feature allows one to find out what type of browser is being
used.
•There are two objects used for this:
➢navigator.appName : returns the name of the browser.
➢navigator.appVersion : returns the version of the browser.
Example 14 :: browser detection
<SCRIPT language="JavaScript">
var browserName = navigator.appName; var
browserVersion = navigator.appVersion;
if (browserName=="Netscape")
alert ("Hi Netscape User!" + browserVersion); else
if (browserName=="Microsoft Internet Explorer") alert
("Hi, Explorer User!" + browserVersion);
else
alert ("Unrecognized browser!");
</SCRIPT>
HI, Explorer User 4.0 Compatible MSI 5.01
windows NT 5.0