我收到此错误
Uncaught ReferenceError: loadNext is not defined
(anonymous function)
导致此问题的行是
<img name="imageLoad" class="hiddenPic" src="<?php echo "albums/$folder/$startImage"; ?>" onLoad="javascript:loadNext();" />
指的是图像标签上方的这个函数。
function loadNext() {
///alert("maxphoto="+maxPhoto+"start="+start+"loadingindex"+loadingIndex);
loadingIndex = nextPhotoToLoad(1, maxPhoto,start, loadingIndex);
if (loadingIndex != '')
{
document.images['imageLoad'].src = img[loadingIndex-1];
}
}
函数已定义。为什么我收到一条错误消息,提示未定义?
编辑:这是整个文件。 http://pastebin.com/gu1V5RMd
最佳答案
尝试 onload="loadNext()"
而不是 onLoad="javascript:loadNext();
P.S.:确保您的函数定义被脚本标记包围。
关于javascript - Uncaught ReferenceError : loadNext is not defined (anonymous function),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5085272/