blob: 43e427dfeab42544a8d3f37505a7ec9f44a7abe9 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
<!DOCTYPE html>
<html>
<head>
<style>
div {
font-size: 4em;
}
</style>
</head>
<body>
<img id="test-image" src="longcattop.png">
<div id="test-output"></div>
<script>
var testImage = document.getElementById('test-image');
var testOutput = document.getElementById('test-output');
testImage.onload = function() {
testOutput.innerHTML =
"width: " + testImage.naturalWidth + ", " +
"height: " + testImage.naturalHeight;
alert(testOutput.innerHTML);
};
</script>
</body>
</html>
|