get canvas obj

check if canvas context exists in js