Well I hope you found an alternative solution. If not, you could approach this very differently: create a function in the head section of your page and refer to it from these instances, rather than including so much content directly.
Printable View
Well I hope you found an alternative solution. If not, you could approach this very differently: create a function in the head section of your page and refer to it from these instances, rather than including so much content directly.
That is exactly what I did. Now I'm finding that the functions (2) will not execute onclick. I just tried to attach the main files but php is not accepted. Here is the code for the functions which are declared in the <head>. Does anything strike you as odd? Thanks for your attention here!
[code]<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>[code]
Error message: functions "not defined"
Functions are executing, no errors. I corrected the onBlur code, too. It looks like either count is not being decremented in directionBack() or imageToDiv is not replacing the html. These are the functions as they stand now.
Code:<script type="text/javascript">
function directionBack()
{if (count > 1){
count = count - 1;
return count;
}}
</script>
<script type="text/javascript">
function imageToDiv(count) {
var imageURL = '<img src="images/painting_' + count + '.jpg" />';
document.getElementById("imagediv").innerHTML = imageURL;
return true;
}
</script>
This problem has been solved. If anyone wants the code, just ask.