Prevent Specific Javascript/jQuery script to run in Oxygen

28 Oct 2022
jQuery(document).ready(function($) {

if($('html').attr('ng-app') == 'CTFrontendBuilder') return;

// YOUR CODE, which will work only in the public part of the site


Note : The use-cases for this are below :

1. Using Swiper Slider and want to edit all the slides in Oxygen and show slider view only on front-end.

2. Using Scripts that runs only on front-end or load after the page-load. In Oxygen builder they displays an error like ‘SCRIPTNAME’ is not defined or is undefined.

3. and much more.

Was this article helpful?



Never miss new post again

Subscribe and get list of new posts in your inbox

Click to Copy