check if window and jquery are present to allow invocatino from execjs