estesflyer
Programmer
hello, im just starting out w/ javascript, and im learning it through the webmonkey tutorials. my "assignment" or whatever was to write an image swap program, like,you move your cursor over the image, and it'll change, move your mouse over the image again, and it'll change again. it has 3 diff images in it. here is the source code. its really confusing, but not the prompt part, just the actual image swapping part.
<html>
<head>
<title>title</title>
<script language="JavaScript">
<!-- hide me
var temp = "";
var image1 = '/webmonkey/98/03/images2a/thau.gif';
var image2 = '/webmonkey/98/03/images2a/sky.gif';
var image3 = '/webmonkey/98/03/images2a/monkey.gif'
var user_name = prompt("What's your name", ""
if (user_name == ""
{
user_name = "stranger";
}
// end hide -->
</script>
</head>
<body>
<h1>Browser Configuration</h1>
<h2>Welcome
<script language="JavaScript">
<!-- hide me
document.write(user_name);
// end hide -->
</script>
<a href="#"
onMouseOver="temp=image1; image1=image2; image2=image3; image3=temp; document.the_image.src=image1;"
onClick="document.brand_image.src=image1;">
<img src=" name="the_image" border=0></a>
-Rusty
<html>
<head>
<title>title</title>
<script language="JavaScript">
<!-- hide me
var temp = "";
var image1 = '/webmonkey/98/03/images2a/thau.gif';
var image2 = '/webmonkey/98/03/images2a/sky.gif';
var image3 = '/webmonkey/98/03/images2a/monkey.gif'
var user_name = prompt("What's your name", ""
if (user_name == ""
{
user_name = "stranger";
}
// end hide -->
</script>
</head>
<body>
<h1>Browser Configuration</h1>
<h2>Welcome
<script language="JavaScript">
<!-- hide me
document.write(user_name);
// end hide -->
</script>
<a href="#"
onMouseOver="temp=image1; image1=image2; image2=image3; image3=temp; document.the_image.src=image1;"
onClick="document.brand_image.src=image1;">
<img src=" name="the_image" border=0></a>
-Rusty