Problem in reloading app.js from server on button click

i app.js, controller.js and all html file on one server except login.html and index.html page,On application load script and file are loaded from server ,i want to put a url field in login page ,in which new server url /path set and on click of a button ,i want to load app.js and controller.js and html file from that new server url once again replace with previous one.

i stuck at problem that app.js load only once at application open time,but i want to replace it with new app.js from another server on button click. on login field