Title: Javascript Not Work in Elementor Edit Page
Last modified: August 12, 2021

---

# Javascript Not Work in Elementor Edit Page

 *  [mortezayung](https://wordpress.org/support/users/mortezayung/)
 * (@mortezayung)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/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)

 *  [rddigital](https://wordpress.org/support/users/rddigital/)
 * (@rddigital)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/javascript-not-work-in-elementor-edit-page/#post-14845280)
 * 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 4 years, 9 months ago by [rddigital](https://wordpress.org/support/users/rddigital/).

Viewing 1 replies (of 1 total)

The topic ‘Javascript Not Work in Elementor Edit Page’ is closed to new replies.

 * ![](https://ps.w.org/elementor/assets/icon-256x256.gif?rev=3444228)
 * [Elementor Website Builder - more than just a page builder](https://wordpress.org/plugins/elementor/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/elementor/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/elementor/)
 * [Active Topics](https://wordpress.org/support/plugin/elementor/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/elementor/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/elementor/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [rddigital](https://wordpress.org/support/users/rddigital/)
 * Last activity: [4 years, 9 months ago](https://wordpress.org/support/topic/javascript-not-work-in-elementor-edit-page/#post-14845280)
 * Status: not resolved