add javascript for source type