Support » Plugin: Elementor Website Builder » Javascript Not Work in Elementor Edit Page

  • Hi i just added this codes for register scripts, But it doesn’t work in Elementor edit page but work perfectly in preview page!

    public function __construct($data = [], $args = null) {
            parent::__construct($data, $args);
    
            wp_register_style( 'slick-style', Url_Plugin . 'assets/css/slick.css', array() , '1.8.1' );
            wp_register_script( 'jquery-slick', Url_Plugin . 'assets/js/slick.min.js', [ 'elementor-frontend' ], '1.8.1', true );
            wp_register_script( 'scripts', Url_Plugin . 'assets/js/scripts.js', array( 'jquery' ), '1', true );
        }
    
        public function get_script_depends() {
            return [ 'jquery-slick', 'scripts' ];
        }
        
        public function get_style_depends(){
            return [ 'slick-style' ];
        }

    And one script file register outside of Elementor widget and this script file doesn’t work too!!

Viewing 1 replies (of 1 total)
  • Same situation, but it works only if i have not optimized plugin enabled. In both cases i have a js error : elementorFrontendConfig is not defined. With Optimized this error means entire code error

    	public function __construct($data = [], $args = null) {
    		parent::__construct($data, $args);
    
    		wp_register_script( 'slick', get_template_directory_uri() . '/assets/js/resources/slick.min.js', [ 'elementor-frontend' ], '1.0.0', true );
    		wp_register_script( 'red-js-slick', get_template_directory_uri() . '/assets/js/slick-carousel.js', [ 'elementor-frontend','slick' ], '1.0.0', true );
    		wp_register_style( 'red_tmp_styles-slick_carousel', get_template_directory_uri() . '/assets/css/elementor_elements/slick_carousel.css');
    	}
    	
    	public function get_script_depends() {
    		return [ 'slick','red-js-slick' ];
    	}
    
    	public function get_style_depends() {
    		return [ 'red_tmp_styles-slick_carousel' ];
    	}
    • This reply was modified 2 months, 3 weeks ago by rddigital.
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.