Implement 'pcJ' to print block in Javascript