You can use the designer to save to a JavaScript file. You can use code to load a JavaScript file.
For more information, refer to Saving and Loading JavaScript Files.