Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

image load fail event html

function testImage(URL) {
    var tester=new Image();
    tester.onload=imageFound;
    tester.onerror=imageNotFound;
    tester.src=URL;
}

function imageFound() {
    alert('That image is found and loaded');
}

function imageNotFound() {
    alert('That image was not found.');
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: Half or Right Triangle star pattern in JavaScript 
Javascript :: run another process on nodejs process exit 
Javascript :: how to create an async function from a string in node js 
Javascript :: Open props 
Javascript :: string js 
Javascript :: generator function 
Javascript :: javascript compress base64 image 
Javascript :: vue js qr code scanner 
Javascript :: rest parameters 
Javascript :: Create A Promise And Then Return It 
Javascript :: regex for fullstop 
Javascript :: cross origin http://localhost forbidden jest 
Javascript :: javascript count occurence of character in string 
Javascript :: vuejs nested v-for 
Javascript :: hide an element when window resize css 
Javascript :: javascript true string to boolean 
Javascript :: how to write a function in javascript 
Javascript :: Symbol Methods javascript 
Javascript :: Angular p-dialog 
Javascript :: javascript detect paste contents 
Javascript :: javascript loop backwards 
Javascript :: if javascript 
Javascript :: mongoose read 
Javascript :: pop javascript 
Javascript :: update node two versions mac 
Javascript :: react hooks 
Javascript :: check if refresh token expired redirect 
Javascript :: chrome version 
Javascript :: /learn ES6: Use the Spread Operator to Evaluate Arrays In-Place 
Javascript :: event.target.name in setstate 
ADD CONTENT
Topic
Content
Source link
Name
8+7 =