Validate Image from url using Java script

by satheeshkumar 2014-03-20 13:13:08

Validate Image from url using Java script,

Find weather the given url contains image or not using js,


var img = new Image();
img.src = "http://hiox.org/images/logo.png";
var imwidth = img.width;
var imheight = img.height;
if(imwidth==0)
{
alert("valid image url")
}
else
{
alert("Invalid image url")
}


1061
like
0
dislike
0
mail
flag

You must LOGIN to add comments