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

python - Why doesn't list have safe "get" method like dictionary? -

razor - Is this a bug in WebMatrix PageData? -

sql server - Stored procedure -