How is it possible to pass a parameter via a function that runs upon onload
of an off-screen image? Like for example:
(...)
function first_function(PARAMETER){
preload_image = new Image(800,600);
preload_image.onload = photo_preloaded(PARAMETER);
preload_image.src = 'images/photo.jpg';
}
function photo_preloaded(PARAMETER){
alert(PARAMETER)
}
(...)Yes:
Is is possible to run the second function only if the image has been
preloaded, with the parameter? If so, how would this be constructed?
function first_function (PARAMETER) {
preload_image = new Image(800,600);
preload_image.onload = function () { photo_preloaded(PARAMETER); };
preload_image.src = 'images/photo.jpg';
}
--
Jorge.