Javascript.. the proper way?
-
Okay, Yes I am new, and I need some assitance and defining the proper way to add javascript .js files..
It seems both ways do the same thing.. but what is the proper method?
I Have read many tutorials online.. and got a bit confused..
wp_enqueue_script( 'easing', get_template_directory_uri() . '/js/jquery.easing.1.3.js', array('jquery') ); wp_enqueue_script( 'common', get_template_directory_uri() . '/js/jquery.common-min.js',array('jquery') ); wp_enqueue_script( 'sequence', get_template_directory_uri().'/js/sequence.jquery-min.js', array('jquery') ); wp_enqueue_script( 'quicksand', get_template_directory_uri().'/js/jquery.quicksand.js', array('jquery')); wp_enqueue_script( 'flex', get_template_directory_uri().'/js/jquery.flexslider-min.js', array('jquery') ); wp_enqueue_script( 'pretty', get_template_directory_uri().'/js/jquery.prettyPhoto.js', array('jquery')); wp_enqueue_script( 'carousel', get_template_directory_uri().'/js/jquery.jcarousel.min.js', array('jquery') ); wp_enqueue_script( 'tipsy', get_template_directory_uri().'/js/jquery.tipsy.js', array('jquery'), '1.0'); } add_action( 'wp_enqueue_scripts', 'scripts_basic' ); or wp_register_script( 'easing', get_template_directory_uri() . '/js/jquery.easing.1.3.js', array('jquery') ); wp_register_script( 'common', get_template_directory_uri() . '/js/jquery.common-min.js',array('jquery') ); wp_register_script( 'sequence', get_template_directory_uri().'/js/sequence.jquery-min.js', array('jquery') ); wp_register_script( 'quicksand', get_template_directory_uri().'/js/jquery.quicksand.js', array('jquery')); wp_register_script( 'flex', get_template_directory_uri().'/js/jquery.flexslider-min.js', array('jquery') ); wp_register_script( 'pretty', get_template_directory_uri().'/js/jquery.prettyPhoto.js', array('jquery')); wp_register_script( 'carousel', get_template_directory_uri().'/js/jquery.jcarousel.min.js', array('jquery') ); wp_register_script( 'tipsy', get_template_directory_uri().'/js/jquery.tipsy.js', array('jquery'), '1.0'); wp_enqueue_script( 'easing' ); wp_enqueue_script( 'common' ); wp_enqueue_script( 'sequence' ); wp_enqueue_script( 'quicksand' ); wp_enqueue_script( 'flex' ); wp_enqueue_script( 'pretty' ); wp_enqueue_script( 'carousel' ); wp_enqueue_script( 'tipsy' ); } add_action( 'wp_enqueue_scripts', 'scripts_basic' );
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Javascript.. the proper way?’ is closed to new replies.