Support » Fixing WordPress » js file loaded but browser says not a function

  • rahul14


    I passed my whole day searching for the solution.
    I have loaded waypoints jquery plugin. but browser is showing

    TypeError: jQuery(...).waypoint is not a function
    Line 53

    please help me. below code i am using in function to load scripts:

    function foundation_assets() {
    	if (!is_admin()) {
    		// Load JavaScripts
    		wp_enqueue_script( 'jquery');
    		wp_enqueue_script( 'waypoints', get_template_directory_uri().'/javascripts/waypoints.min.js');
    		wp_enqueue_script( 'theme', get_template_directory_uri().'/javascripts/theme.js');
    		wp_enqueue_script( 'foundation', get_template_directory_uri() . '/javascripts/foundation.min.js', array(), '1.0', true );
    		wp_enqueue_script( 'app', get_template_directory_uri().'/javascripts/app.js', array('foundation'), '1.0', true );
    		// Load Stylesheets
    		wp_enqueue_style( 'app', get_stylesheet_uri(), array('foundation') );
    		wp_enqueue_style( 'foundation', get_template_directory_uri().'/stylesheets/foundation.min.css' );
    		wp_enqueue_style( 'icon-fonts', get_template_directory_uri().'/fonts/style.css' );
    		// Load Google Fonts API
    		wp_enqueue_style( 'google-fonts', ',300' );
    add_action( 'wp_enqueue_scripts', 'foundation_assets' );
  • The topic ‘js file loaded but browser says not a function’ is closed to new replies.