This is my first time using lightbox which uses jquery framework. But when I paste jQuery and Lightbox javascript files into my html page, my current javascript code doesn’t work properly. Is the way I set them up wrong? Thank you. This is the order I put my js files
the error I got is:
Uncaught TypeError: Object [object Object] has no method ‘dispatchEvent’ prototype.js:5734
Edit:
<script src="https://ajax.googleapis.com/ajax/libs/prototype/1.7.0.0/prototype.js" type="text/javascript"></script>
<script src="random.js" type="text/javascript"></script>
<script src="js/jquery-1.7.2.min.js"></script>
<script src="load-poll.js" type="text/javascript"></script>
<script src="js/lightbox.js"></script>
And this is the beginning of my own js file as the page loads:
var POLL_WIDTH = 200;
document.observe("dom:loaded", function() {
if ($("favChar")){
fetchPoll("favChar");
}else if ($("favVoice")){
fetchPoll("favVoice");
}else if ($("CMTvote")){
fetchPoll("CMTvote");
}else if ($("BLdesign")){
fetchPoll("BLdesign");
}
});
Try using this
instead of