当选择这么宽的图像时!=500像素.,为什么ie7不显示aleart消息


when select image that wide != 500 px., why ie7 not show aleart message?

。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。

当选择这么宽的图像时!=500像素。,为什么ie7不显示aleart消息?

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<input name="offer_image_1" type="file" id="offer_image_1" />
<script type="text/javascript">
var _URL = window.URL || window.webkitURL;   // for check wide and height image
$("#offer_image_1").change(function(e) {
    var offer_image_1, img;
    if ((offer_image_1 = this.files[0])) {
        img = new Image();
        img.onload = function() {
            if (this.width != '500')
            {
            alert("not width 500 px.");
            }
        };
        img.src = _URL.createObjectURL(offer_image_1);
    }
});
</script>

试试这个,

  if (this.width() != '500')
  {
      alert("not width 500 px.");
  }