<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> New Document </title>
<script>
function loadImage(url,callback){
var img = new Image();
img.src = url ;
if(img.complete){
callback.call(img);
return ;
}else{
img.onload = function(){
callback.call(img);
}
}
}
function imgLoad(){
alert(this.width);
}
</script>
</head>
<body>
<input type="button" value="loadImage" οnclick="loadImage('7407.jpg',imgLoad)" />
</body>
</html>
<html>
<head>
<title> New Document </title>
<script>
function loadImage(url,callback){
var img = new Image();
img.src = url ;
if(img.complete){
callback.call(img);
return ;
}else{
img.onload = function(){
callback.call(img);
}
}
}
function imgLoad(){
alert(this.width);
}
</script>
</head>
<body>
<input type="button" value="loadImage" οnclick="loadImage('7407.jpg',imgLoad)" />
</body>
</html>