Only invoke certain JS functions in the appropriate settings.