Enqueue js file
-
Hi Lester,
static function scripts() { if ( !self::$add_script ) return; $js_dev = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '.dev' : ''; //wp_enqueue_script( 'wp-useronline', plugins_url( "useronline$js_dev.js", __FILE__ ), array( 'jquery' ), '2.80', true ); wp_enqueue_script( 'wp-useronline', "/assets/forums/js/useronline$js_dev.js", array( 'jquery' ), '', true ); //get_template_directory_uri() wp_localize_script( 'wp-useronline', 'useronlineL10n', array( 'ajax_url' => admin_url( 'admin-ajax.php' ), 'timeout' => self::$options->timeout * 1000 ) ); scbUtil::do_scripts('wp-useronline'); }as you can see I had to move the js file in my template directory to avoid an Internal server error 500. Have you already thought of another way, different from my example to avoid this error?
B.Regards
tnx
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Enqueue js file’ is closed to new replies.