I am a newbie to Javascript and is recently developing a website with some Javascript function. Its a basic function, where when user point to a thumbnails, a larger version of the image will be loaded.
The larger image might take some time to load, so to show some respond to the user, I will load another image with the word loading on it first, then it will proceed to loading the larger version of the image. The code is as follows:
- Code: Select all
function update(url,index,isSuper){
document['PhotoBig'].src = "loading.gif";
document['PhotoBig'].src=url;
}
So now the problem is, when I point to the thumbnails, the larger version of the image will be loaded immediately instead of loading the loading.gif image first. What had I did wrong?
can anyone advise me on this? Thanks


