• Hi,

    I’ve installed this plugin on one site I run perfectly, but I’m getting the following error on another site:

    Uncaught TypeError: Object [object Object] has no method ‘slickQuiz’

    I’ve seen the posts where it’s mentioned to check whether “wp_footer()” is present, and I can confirm this is so.

    However, I can’t figure out why the error is happening. Any ideas?

    Looking at the source, jQuery is loaded fine in the header, and the slickQuiz JS loads in the footer, but something is messing it up.

    Thanks, Chris.

    https://wordpress.org/plugins/slickquiz/

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author jewlofthelotus

    (@jewlofthelotus)

    @pixelkicks Hey, could you provide a link to a page where the problem is happening? I’ll need to see what’s going on. Thanks!

    Thread Starter pixelkicks

    (@pixelkicks)

    Plugin Author jewlofthelotus

    (@jewlofthelotus)

    Hmm. Well, it looks like the SlickQuiz JS and CSS resources aren’t being added to the page. They should be included wherever the wp_footer() method is added.

    Can you confirm that the page / post template that this particular page is using includes the footer template that contains the wp_footer() call? It might be the case that the footer template includes the call but that this page template doesn’t include the footer template.

    Thread Starter pixelkicks

    (@pixelkicks)

    Yep, it’s all present.

    Here’s the bottom of page.php:

    </div>
            </div>
    
            <?php endwhile; ?>
        <?php endif; ?>
    
    <?php comments_template(); ?>
    
    <?php get_footer(); ?>

    And here’s the bottom of footer.php:

    <?php wp_footer(); ?>
    
            <?php echo (get_option('ga')) ? get_option('ga') : '' ?>
    
    	</body>
    </html>

    What else could it be?

    Plugin Author jewlofthelotus

    (@jewlofthelotus)

    Are you using a different theme or different plugins than the site you have this working on?

    Could you also share the code in the footer template above the wp_footer call? I want to verify if all that is getting output.

    Thanks for your patience on this, it’s a tricky one to debug.

    Thread Starter pixelkicks

    (@pixelkicks)

    The sites are very similar to each other, and mostly use the same plugins.

    Here’s all the footer code:

    <div class="clear"></div>
    
    			<?php if (is_front_page() && !is_paged()) {?>
    				<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Home Bottom') ) : ?><?php endif; ?>
                <?php } ?>
    
                </div>
                <!-- /Content -->
    
                <?php get_sidebar(); ?>
    
                </div>
                <!-- /Container -->
    
                <div class="footer">
                    <p class="copyright"> ###general footer text here###
    </p>
    
                      <div class="clear"></div>
                      <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Footer') ) ?>
                      <div class="clear"></div>
    
                </div>
            </div>
            <!-- W3TC-include-js-head -->
            <?php wp_footer(); ?>
    
            <?php echo (get_option('ga')) ? get_option('ga') : '' ?>
    
    	</body>
    </html>
    Plugin Author jewlofthelotus

    (@jewlofthelotus)

    Do you have a caching plugin installed? You could try clearing the cache out.

    I’m really not sure why wp_footer would be outputting some scripts but not others. It’s very strange. I’ll keep looking for an answer, but for now to get things working, you could add the following right above the wp_footer line:

    `
    <link rel=’stylesheet’ id=’slickquiz_css-css’ href=’http://onepopz.com/wp-content/plugins/slickquiz/slickquiz/css/slickQuiz.css&#8217; type=’text/css’ media=’all’ />
    <link rel=’stylesheet’ id=’slickquiz_front_css-css’ href=’http://onepopz.com/wp-content/plugins/slickquiz/css/front.css&#8217; type=’text/css’ media=’all’ />
    <script type=’text/javascript’ src=’http://onepopz.com/wp-content/plugins/slickquiz/slickquiz/js/slickQuiz.js’></script&gt;
    `

    That will manually include the necessary files to get the quiz working.

    Let me know if that doesn’t work.

    Thread Starter pixelkicks

    (@pixelkicks)

    Yes we use Total Cache, but so does the other site and it works fine on that.

    Sometimes we have problems with JS files being called before jQuery is, but in this case that isn’t happening because we have minification switched off for that and it’s simply not being called anywhere.

    Adding those lines manually to the site works fine though. However we wouldn’t like to load it on every single page – we always try to keep our bloat as low as possible.

    Anything else I can try?

    Plugin Author jewlofthelotus

    (@jewlofthelotus)

    Well, I would definitely try resetting the cache. It might have been created before SlickQuiz was enabled, and for some reason has not yet been refreshed.

    You could move those script inclusions to the SlickQuiz plugin’s php/slickquiz-front.php file. I would insert them right before line 74:

    https://github.com/jewlofthelotus/SlickQuiz-WordPress/blob/master/php/slickquiz-front.php#L74

    That would add them to the page only if there is a quiz present.

    You’ll just need to remember if you update the plugin to add them back if it’s still not working on its own.

    I wish I had something better to offer but this is a really weird issue that I’ve not seen before and can’t find much talk of on the interwebs.

    Thread Starter pixelkicks

    (@pixelkicks)

    I’m logged in as admin so the cache doesn’t apply. Ok will consider adding it to the code but like you say it would be lost with any updates!

    I’ll try seeing what the differences between our other site is. Great plugin though – here’s our first quiz working fine on the other site http://www.onedirection.net/quiz-much-know-one-directions-upcoming-tour/

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Uncaught TypeError: Object [object Object] has no method 'slickQuiz'’ is closed to new replies.