paynecou:
I am also successfully running more than one javascript on an html page..
If you review the code posted below, you'll see How I call each of the scripts..
Code:
<html>
<head><title>Welcome to PSP Embroidery!</title>
<script language="JavaScript" type="text/javascript" >
if (document.images) {
var boardNum = 0;
var boardSpeed = 2000;
// Create an array of images for the billboard
var billboard = new Array();
billboard[0] = new Image();
billboard[0].src = "zsk-intl.jpg";
billboard[1] = new Image();
billboard[1].src = "ginko.gif";
billboard[2] = new Image();
billboard[2].src = "squirrel_logo.gif";
// Create an array of URLs that correspond to the images
var url = new Array();
url[0] = "http://www.zsk.com";
url[1] = "http://www.strawberrystitch.com/shop/GD-Sales.html";
url[2] = "http://www.gonutsgocreative.com/home/default.asp";
}
// Function to rotate the images on the billboard
function rotateBoard() {
if (boardNum < (billboard.length - 1)) {
boardNum++;
}
else {
boardNum = 0;
}
document.billboard.src = billboard[boardNum].src;
setTimeout('rotateBoard()', boardSpeed);
}
// Function to load the appropriate URL when the user clicks on an image
function jumpBillboard() {
window.location = url[boardNum];
}
</script>
<SCRIPT SRC=ban1_rotate.js LANGUAGE=
JAVASCRIPT TYPE="TEXT/JAVASCRIPT">
</SCRIPT>
</head>
<body BACKGROUND="scotch.bmp" onLoad="rotate();if (document.images) setTimeout('rotateBoard()', boardSpeed);">
See, one of the critical things is that you enclose your individual scripts within their respective <script></script> tags, and that you handle the call to the functions properly within the <BODY> tag, like above!
Review this link: http://www.javascriptkit.com/javatut...iplejava.shtml
Good Luck!
JavaTom
Bookmarks