added usage for JS to whitespace_only and simple compilation modes
added checks for dom element in the render function