K
Krzysztof Ciuba
Hello,
I skimmed through the news but couldn't find the solution.
I have problem with getting proper width and height values of an image.
Here is the piece of code:
<HTML>
<HEAD>
<script Language='javascript1.2' type='text/javascript'>
<!--
var imgsrc = "c:/pic1.jpg";
function iLoad(isrc) {
var oImg = new Image();
oImg.src = isrc;
if (oImg.complete) {
window.alert(oImg.src + ' ' + oImg.width + ' x ' + oImg.height);
}
else {
window.setTimeout('iLoad(imgsrc)', 1000);
}
}
//-->
</script>
</HEAD>
<body onLoad='iLoad(imgsrc)'>
</body>
</HTML>
The above works fine, but the problem occures when I replace image file on
local disk with another one (the same file name). Then the code still
returns "old" picuture's values. I assume it's because of caching.
Is there any solution that I can get proper values every time, also after
replacing files?
Thanks for your help.
Krzysztof C.
I skimmed through the news but couldn't find the solution.
I have problem with getting proper width and height values of an image.
Here is the piece of code:
<HTML>
<HEAD>
<script Language='javascript1.2' type='text/javascript'>
<!--
var imgsrc = "c:/pic1.jpg";
function iLoad(isrc) {
var oImg = new Image();
oImg.src = isrc;
if (oImg.complete) {
window.alert(oImg.src + ' ' + oImg.width + ' x ' + oImg.height);
}
else {
window.setTimeout('iLoad(imgsrc)', 1000);
}
}
//-->
</script>
</HEAD>
<body onLoad='iLoad(imgsrc)'>
</body>
</HTML>
The above works fine, but the problem occures when I replace image file on
local disk with another one (the same file name). Then the code still
returns "old" picuture's values. I assume it's because of caching.
Is there any solution that I can get proper values every time, also after
replacing files?
Thanks for your help.
Krzysztof C.