This is also working with older version of KJS, using the getCanvas method :
$("#save").click(function () {
var dataUrl = layer.getCanvas().toDataURL();
var img = new Image();
img.onload = function () {
$("body").append("<p>Right-click the image below & then 'save-as'</p>");
document.body.appendChild(img);
}
img.src = dataUrl;
//window.open(dataUrl);
});