I have a simple page that has a (non-Prototype) JavaScript pop-up for login. It has been working fine. But when I add the Prototype framework to the page the pop-up quits working.
<script type="text/javascript" src="recipes/js/prototype.js"></script>
<script type="text/javascript">
var imgnum = 1;
function nextimg() {
/* <![CDATA[ */
imgnum++;
if (imgnum > 5) imgnum = 1;
var nextimg = 'recipes/img/iphone_' + imgnum + '.png';
var nextimg2 = 'recipes/img/iphone_' + (imgnum + 1) + '.png';
imagepreload = new Image();
imagepreload.src = nextimg2;
$('iphoneimg').src=nextimg;
/* ]]> */
}
</script>
I have tried to move the JS include to the bottom, with no luck. Any ideas?
Also, it works fine in IE but not Firefox or Safari.
Prototype takes the $ function that JQuery also uses (are you using JQuery?).
See here