added javascript is evaluated only in view mode