adding a javascript function to remove js files from dom so that we can handle large doms