I have already search for several websites through net. I still have the problem that: I choose window.load
to execute the following code, but my blanket of height is always undefined.
<!DOCTYPE html>
<html>
<head>
<title>Tobyliao</title>
<script src="jquery-3.2.1.min.js" type="text/javascript"></script>
<script type="text/javascript"> // $(window).on('load', function() { ... }); $(document).ready(function(){ // $('#div1').html('Height='+$('img1').height()+'Width='+$(img1).width()); }); $(window).on("load", function(){ $('#div1').html('Height='+$('img1').height()+'<br/>'+'Width='+$(img1).width()); }); </script>
<div id="div1"></div>
<img src="microsd.jpg" id="img1">
</head>
<body> </body>
</html>