I'm trying to load a civicrm function. What is the recommended way to load 'CRM' checking that it is available on the page first?

CRM.$(function ($) {
  'use strict';



I've wrapped it with try / catch

try {
  CRM.$(function ($) {
} catch (e) {}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.