Javascript API not working for Carbon Fields?

322 Views Asked by At
$(document).on('carbonFields.apiLoaded', function(e, api) {
    // Get the current value in the 'crb_text' field
    var value = api.getFieldValue( 'crb_text' );
    console.log(value);
});

As mentioned in the doc https://carbonfields.net/docs/advanced-topics-javascript-api/ I tried the following code but it does not work. The apiLoaded event is not triggering. Any idea why?

jQuery is loaded. I do not get any errors. But it is not working either.

0

There are 0 best solutions below