node-webshot icon indicating copy to clipboard operation
node-webshot copied to clipboard

how to use stream render the img in html

Open gagayang opened this issue 9 years ago • 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

gagayang avatar May 17 '17 10:05 gagayang