Though I have declared both functions in <head>, they will not execute. The file that calls the functions is a php include. The main file is painting.php. I hope this isn't too much information. Thanks!
Here are the two functions:
The file that calls the functions onclick.
The main file.
Here are the two functions:
Code:
function directionBack()
{
document.write("Im here in directionBack");
if (count > 1)
count = count - 1;
return count;
}
Code:
function imageToDiv(count)
{
document.write("Im here in imageToDiv");
imageURL = "<img src=\'images/painting_\' + count + \'.jpg' />";
document.getElementById("imagediv").innerHTML = imageURL
return false;
document.write(count);
document.write(imageURL);
}
The file that calls the functions onclick.
Code:
<a href="" id="link1" class='link'><img src='images/braceL.gif' alt='brace' width='20' height='11' valign='text-bottom' onFocus="if(this.blur)this.blur)" onclick="directionBack(); imageToDiv(count)"/></a>
<a href="thumbnails.php" class="linkCurrent" target="_self" onFocus="if(this.blur)this.blur)" />PAINTINGS</a>
<a href="painting_<?php echo $paintingNext; ?>.php" class="link" target="_self" onFocus="if(this.blur)this.blur()" /><img src="images/braceR.gif" alt="brace" width="20" height="14" valign="text-bottom" onFocus="if(this.blur)this.blur()" /></a>
The main file.
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml"[/URL] xml:lang="en-US" lang="en-US">
<?php $thisPage="fullPainting"; ?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="styles.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="scripts/directionBack.js"></script>
<script type="text/javascript" src="scripts/imageToDiv.js"></script>
<script type="text/javascript">
var count;
var imageURL;
</script>
<script type="text/javascript">
function directionBack()
{
if (count > 1)
count = count - 1;
return count;
}
</script>
<script type="text/javascript">
function imageToDiv(count)
{
imageURL = "<img src=\'images/painting_\' + count + \'.jpg' />";
document.getElementById("imagediv").innerHTML = imageURL
return false;
}
</script>
<title>STEPHANIE PEEK</title>
</head>
<body>
<div id="center" align="center">
<div id="container">
<div id="main">
<?php
$paintingNumber = $_REQUEST["paintingNumber"];
?>
<?php include ("includes/topNav.php"); ?>
<div class="clear"></div>
<div class="painting" id="imagediv"><img src="images/painting_<? echo $paintingNumber; ?>.jpg" /></div>
<div class="clear"></div>
<div class="caption">
<?php include ("includes/caption.php"); ?>
</div><!--caption -->
</div><!--end main -->
</div><!--end container -->
</div><!--end center -->
</body>
</html>[code]