file is already there in web page,
you can change this temp.js
but i m not sure about the way you are doing is working or not.
its better you change your temp.js
file after loading the page or on any other event
hope this will help you.