jquery在internet explorer中工作不正常

jquery在internet explorer中工作不正常,jquery,internet-explorer,Jquery,Internet Explorer,以下jQuery函数仅在InternetExplorer8中提供错误消息“断开图像!”。它在Chrome和Firefox中运行良好。有什么想法吗 function displayPortrait() { $('#big_picture').html('<img src="css/img/loading_img.gif" style="margin-top: 200px; margin-left:250px;" />'); var img = $("<img /&g

以下jQuery函数仅在InternetExplorer8中提供错误消息“断开图像!”。它在Chrome和Firefox中运行良好。有什么想法吗

function displayPortrait()
{
   $('#big_picture').html('<img src="css/img/loading_img.gif" style="margin-top: 200px;  margin-left:250px;" />');
   var img = $("<img />").attr('src', 'css/img/portrait.jpg').attr('style', 'margin-left:100px;margin-top:0px;').load(function() {
     if (!this.complete || typeof this.naturalWidth == "undefined" || this.naturalWidth == 0) {
         alert('broken image!');
     } else {
         $("#big_picture").html(img);
     }
  });
}
函数displaytrait()
{
$(“#大图”).html(“”);
var img=$(“见此:
naturalWidth
naturalHeight
在IE 8中不受支持