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

razor - Is this a bug in WebMatrix PageData? -

iphone - Requiring the presence of a method in an id -

xslt - Is it possible to select a node that just includes a subset of the child nodes? -