brenden/node-webshot

how to use stream render the img in html

Opened this issue · 0 comments

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