HOME BLOG PORTFOLIO PHOTO CONTACT Admin Login
how to display blob image in html using javascript and php

how to display blob image in html using javascript and php

----------------------------PHP CODE------------------------------------------

$IMAGE = base64_encode($IMAGE);

----------------------------JAVASCRIPT CODE------------------------------------------

var image="data:"+response[i].TYPE+";base64,"+response[i].IMAGE;
tr_str+= "<li class='header-cart-item flex-w flex-t m-b-12'>"+
"<div class='header-cart-item-img'>"+

//"<img src='images/item-cart-01.jpg' alt='IMG'>"+

//"<img title="+response[i].NAME+ "alt="+response[i].NAME+ "src=data:'"+response[i].TYPE+"';base64,' + base64_encode(response[i].TYPE) + '" />"+


//"<img src='"+image+"' alt='IMG'>"+


"<img src='"+image+"' alt='"+response[i].NAME+"' title='"+response[i].NAME+"'>"+


"</div>"+


"<div class='header-cart-item-txt p-t-8'>"+

"<a href='#' class='header-cart-item-name m-b-18 hov-cl1 trans-04'>"+

//"White 1 Shirt Pleat OK JAY"+

response[i].NAME+

"</a>"+


"<span class='header-cart-item-info'>"+

response[i].HOWMANY+" Pc x Rs "+response[i].PRICE+" , Size: "+response[i].SIZE+" Years"

"</span>"+

"</div>"+

"</li>";

$("#jay45").html(tr_str);

 

----------------------------PHP-HTML CODE------------------------------------------

<?php echo '<img title="'.$pName3.'" alt="'.$pName3.'" src="data:'.$iType3.';base64,' . base64_encode($data3) . '" />'; ?>

 

   Share on Facebook

Page views:795