K
K
Kusmich2015-09-30 10:14:09
JavaScript
Kusmich, 2015-09-30 10:14:09

Why is there an error when checking for image loading?

There is a code that checks if the images have loaded. But the error knocks out: Uncaught ReferenceError: image is not defined. Tell me what could be the reason?

Here is the code:

image.onload = function(){
    alert("привет")
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vitaly Inchin ☢, 2015-09-30
@Kusmich

image is not defined

Literally: " image is not defined ".

D
Dmitry Kovalsky, 2015-09-30
@dmitryKovalskiy

And what is image write? Or is it just a variable in a clean field? If it is a reference to an element in the DOM then show how it is initialized.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question