Method to require JS libraries before calling other script functions