Conditionally load js and css files from JavaScript