Javascript for external entity