I have several forms pages which share some of the same fields. These field-sets have been turned into reusable code modules and are imported into each page's DOM using PHP require() statements.
These field-sets have corresponding jQuery event handlers which perform field validation as well as miscellaneous UI-related tasks. I would like to make these handlers reusable, as well.
Previously, I've always declared such handlers within the $(document).ready() event.
If I'm going to import these handlers from an external file, it is my understanding they still need to be included directly into the $(document).ready() event, rather than imported using a standard HTML <script> tag pair.
In PHP, I'd simply include() or require() the code block like I do with the field-sets. How do I perform the equivalent in JS as simply as possible? Preferably without adding yet another framework, I might add.