Here http://jsfiddle.net/m3e1kdzu/9/ is what i am trying
First div is html with data:image;base64
<div id="large_photo_null" style="width:50px; height:50px;
background-image: url( data:image;base64,R0lGODlhR.. );" >
</div>
With html i see background image as expected.
Now trying to set background image for another div. But no changes. Can not set
Here is code
<div id="large_photo" style="width:100px; height:150px;" >
This is as if large photo where expect to change background
</div>
<div class="thbn_photo" style="width:100px; height:150px;" >
As if thumbnail photo. Click here.
</div>
Here jquery
$(document).on('click', '.thbn_photo', function(){
alert('thbn_photo clicked');
$('#large_photo').css( 'background-image: url( data:image;base64,R0lGODlhRgAzAJEAAMr.. );' );
});
What is wrong? My code is incorrect or with jquery can not set data:image;base64
?
Now found similar topic Is there a way to set background-image as a base64 encoded image in javascript?
Will check