how to use stream render the img in html
gagayang opened this issue · 0 comments
gagayang commented
hello
I try to use your code demo make a project, bug I find some problem.
this is my node server code
webshot('http://www.baidu.com', options, function(err, renderStream){
// var coding = renderStream.getEncoding();
renderStream.pipe(res);
})
this is my js code
$.ajax({
url: "/getPhoto"
,contentType: "text/html"
}).done(function(data) {
var url = window.URL || window.webkitURL;
$("#container").html('<img src="'+data+'" />');
});
I find the 'data' is Garbled, it does not work as my target.
please help me, thank you