Implementing Java for a slide show

This seems to be the least offensive (code wise) for a simple slid show in a web page.

All I get is a blank frame of the correct dimensions with a small red x in the corner.

I think my problem might be that I don’t know how to implement java into this script.

I have C:\Java\jdk.1.7.0\jre6\jre7.

This is from : http://www.javascriptkit.com/howto/show2.shtml



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en" />
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="Content-Language" content="en"/>
<meta name="keywords" content="orange county real estate, local broker, local real estate broker, local agent, local real estate agent, orange county real estate broker, orange county real estate agent." />
<title>Properties With Style Home Page Orange County Real Estate</title> 
<link type="text/css" rel="stylesheet" href="" media="screen,projection,tv"/>
<script type="text/javascript">

var image1=new Image()
image1.src="c:\\mydesign\\css\\images\\bayfrontyard.jpg"
var image2=new Image()
image2.src="c:\\mydesign\\css\\images\\villagecolor.jpg"
var image3=new Image()
image3.src="c:\\mydesign\\css\\images\\villagestreetsdown.jpg"
</script>
</head>

<body>
<img align="right""" src="c\\mydesign\\css\\images\\bayfrontyard.jpg" name="slide" width="450" height="270" />
<script>
<!--
//variable that will increment through the images
var step=1
function slideit(){
//if browser does not support the image object, exit.
if (!document.images)
return
document.images.slide.src=eval("image"+step+".src")
if (step<3)
step++
else
step=1
//call function "slideit()" every 2.5 seconds
setTimeout("slideit()",6000)
}
slideit()
//-->
</body>
</html>

Thanks . . . Rick

The script you have posted is JavaScript - not Java so where you have Java installed makes no difference to the script.

All your imagereferences are invalid because \ is an escape character in JavaScript and so you need to specify them all as \\ if you want an actual \ - it is easier to use a / instead.

Thanks Felgall - I believe we have crossed paths before.

So I changed the hash marks to / as that IS easier but no effect.

If I can just get this going then I can easily add more pictures later.

Also - javascript does not need Java on the computer? How is it interpreted then?

What do you suggest next?

Rick

Try changing all the \ to / and see if that fixes the problem.

JavaScript is directly interpreted by the web browser - it is when you include java applets in the web page that the Java plugin is required.

That’s a common misconception. JavaScript and Java are both completely different languages. The only similarity is in their names. Initially JavaScript was called Livescript, which was renamed due to politics to be JavaScript instead.

You can read up about the history of JavaScript as written up by felgall over at http://javascript.about.com/od/reference/a/history.htm