0

我使用 jQuery 刷新了以下 html 代码,但它没有在 chrome 浏览器中显示新图像。

For example: 12.00AM - RED CAR driving
<div class="mycam_local">
          <img src="http://192.168.0.181:8008/liveimage/now.jpeg?1370446579000">
</div>

For example: 04.00AM - still RED CAR (basically its yellow one)
<div class="mycam_local">
          <img src="http://192.168.0.181:8008/liveimage/now.jpeg?1350446549000">
</div>

编辑

$('.my_camera_brightness_up').live("click", function() {
  if (myb>1) {
    myb=1;
  } else {
    myb=myb+0.01;
  }    

  $.ajax({
    type    : "GET",//POST
    dataType: 'json',
    url     : '/a/c',
    data    : url + '&command=brightness;'+myb.toFixed(2),
    async   : true,
    beforeSend: function()
    {

    },
    complete: function()
    {            
    },
    success : function(msg)
    {
      $('.my_camera_buttonstate').html("Updated: " + myb.toFixed(2));
      var xy= "<img src=\"http://" + msg.extra.remoteip + ":7007/video/now.jpeg?"+ Date.parse(new Date().toString() ) + "\" />";
      //$('.mycam_local').find('img').attr('src',  'http://' + msg.extra.remoteip + ':7007/video/now.jpeg' +"?"+ Date.parse(new Date().toString()) );
      alert(xy);
      $('.mycam_lcoal').html(xy);
    }
  });    
});
4

1 回答 1

1

您可以尝试使用此解决方法:

$('.mycam_remote').find('img').attr('src','').attr('src', 'http://' + msg.extra.remoteip + ':7007/video/now.jpeg' +"?"+ Date.parse(new Date().toString()));

看看它是否适合你

于 2013-06-05T16:11:30.443 回答