WordPress.org

Ready to get started?Download WordPress

Forums

wp_enqueue_script problem! (2 posts)

  1. William Rufino
    Member
    Posted 3 years ago #

    Hi There,

    I'm trying to use wp_enqueue_script on my theme, to insert 3 javascript files on my page.

    function mr_forms() {
                    wp_register_script('validate-jquery',  get_bloginfo('template_url') . '/js/jquery.validate.min.js', array('jquery'),FALSE,TRUE);
                    wp_enqueue_script('validate-jquery');
                    wp_register_script('aditional-methods', get_bloginfo('template_url') . '/js/additional-methods.min.js', array('jquery','validate'),FALSE,TRUE);
                    wp_enqueue_script('aditional-methods');
                    wp_register_script('messages-ptbr', get_bloginfo('template_url') . '/js/messages_ptbr.js', array('jquery','validate'),FALSE,TRUE);
                    wp_enqueue_script('messages-ptbr');
                    wp_register_script('forms', get_bloginfo('template_url') . '/js/forms.js', array('jquery', 'maskedinput'), FALSE, TRUE);
                    wp_enqueue_script('forms');
                }
    
                add_action('init', 'mr_forms');

    But only the last javascript, "forms.js" is being inserted on my page, the others arent, does anyone know what might be happening ? and the other doesnt matter...

  2. William Rufino
    Member
    Posted 3 years ago #

    Anyone please?

Topic Closed

This topic has been closed to new replies.

About this Topic