cleanup js to externaml file, remain in preivew when following hyperlinks