Is it okay to do this?
so I can use JavaScript to d
Yup, it is. It is not recommended though, as this'd mean loading several files (multiple HTTP requests) as opposed to loading one bigger file (but one HTTP request only).