skip to Main Content
    public function __construct($data = [], $args = null) {
        parent::__construct($data, $args);
  
        wp_register_script( 'slider-script', get_template_directory_uri() . '/elements/elementor/flexible-posts/slider.js', [ 'elementor-frontend' ], '1.0.0', true  );
        wp_register_script( 'flex-script', get_template_directory_uri() . '/elements/elementor/flexible-posts/js/script.js', [ 'elementor-frontend' ], '1.0.0', true  );
     }
  
     public function get_script_depends() {
         return [ 
            'slider-script',
            'flex-script'
        ];
     }

Error screenshot

Failed to load resource: net::ERR_CONNECTION_REFUSED

2

Answers


  1. slider-script and flex-script both files are properly enqueued.
    Failed to load resource: net::ERR_CONNECTION_REFUSED ( this error is coming due to liverelaod.js file is not found on the given path).

    Login or Signup to reply.
  2. It is properly enqued already and the errors you’re getting are for the different script and the script you’ve enqued are already showing the Console.log() test message you’ve added.

    I see there is no problem with enqueing the script, you might be dealing with some other issue, please continue with debugging.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search