0% found this document useful (0 votes)
51 views

Code

This document contains code snippets for opening new windows and pages from buttons and menus, inserting the current date and time on a webpage, and mapping an image with clickable areas linked to other pages. The first section shows JavaScript to open a new window from a button click and to open a new page based on the selected menu option. The second section inserts the current date and time using VBScript and JavaScript. The third section maps an image and defines clickable areas linked to other pages.

Uploaded by

mramolsalunkhe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views

Code

This document contains code snippets for opening new windows and pages from buttons and menus, inserting the current date and time on a webpage, and mapping an image with clickable areas linked to other pages. The first section shows JavaScript to open a new window from a button click and to open a new page based on the selected menu option. The second section inserts the current date and time using VBScript and JavaScript. The third section maps an image and defines clickable areas linked to other pages.

Uploaded by

mramolsalunkhe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 3

@Open new window by clicking button

<html>
<head>
<script type="text/javascript">
function open_win()
{
window.open("http://www.w3schools.com");
}
</script>
</head>

<body>
<form>
<input type=button value="Open Window" onclick="open_win()">
</form>
</body>
</html>
@Open new page by clicking menu option
<html>
<head>
<script type="text/javascript">
function go()
{
window.location=document.getElementById("menu").value;
}
</script>
</head>
<body>
<form>
<select id="menu" onchange="go()">
<option>--Select a page--</option>
<option value="http://www.w3schools.com">W3Schools</option>
<option value="http://www.microsoft.com">Microsoft</option>
<option value="http://www.altavista.com">AltaVista</option>
</select>
</form>
</body>

</html>
@To insert date & time

<script type="text/vbscript">
document.write("Today's date is " & date())
document.write("<br />")
document.write("The time is " & time())
</script>

<script type="text/javascript">
function startTime()
{
var today=new Date();
var h=today.getHours();
var m=today.getMinutes();
var s=today.getSeconds();
// add a zero in front of numbers<10
m=checkTime(m);
s=checkTime(s);
document.getElementById('txt').innerHTML=h+":"+m+":"+s;
t=setTimeout('startTime()',500);
}
function checkTime(i)
{
if (i<10)
{
i="0" + i;
}
return i;
}
</script>

<MAP name=amol>
@To map image

<AREA shape= target=_top coords=51,20,130,210 href="C:\Documents and Settings\


Administrator\Desktop\TEMP.xls">

<AREA shape=RECT target=_top coords=4,245,125,280 href="about.html">

<AREA shape=RECT target=_top coords=7,203,120,235 href="about.html">

<AREA shape=RECT target=_top coords=0,162,140,197 href="about.html">

<AREA shape=RECT target=_top coords=3,115,157,154 href="about.html">

</MAP>

<IMG height=650 alt="Gharda Foundation" src="C:\Documents and Settings\Administrator\


Desktop\avishkar.jpg" width=207 align=left useMap=#amol border=0>

@Important Sites
http://www.driversdown.com/

You might also like