jquery - Use Ajax or Attributes for Images -


what better dynamically loading images- using ajax function or changing image's src attribute desired link? please supply snippet of code answer. thanks

depends on definition of "better," since javascript doesn't deal binary streams, i'd recommend "changing image's src attribute" option.

var mysource = '/path/to/image.jpg';  var img = new image(); img.src = mysource;  // or  $('#someimageid').attr('src', mysource); 

Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -