• Resolved Viktor Szépe

    (@szepeviktor)


    When you turn off both “Further options” for tabs

    TypeError: jQuery(...).tabs is not a function
    jQuery( "#tag-groups-cloud-tabs" ).tabs();

    I suggest you to use add another condition beside

    if ( !isset( $id ) ) $id = 'tag-groups-cloud-tabs'; else $id = sanitize_html_class($id);

    Thank you!!

    https://wordpress.org/plugins/tag-groups/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi, thanks for reporting!

    Are you sure that this is triggered by these two options (collapsible and hover)? The error message suggests that jQuery doesn’t get loaded. Have you always turned on the other option on that same page “Use jQuery”?

    I cannot reproduce the error. I see it only when I uncheck “Use jQuery”.

    Thread Starter Viktor Szépe

    (@szepeviktor)

    I am sorry.
    Of course “Use jQuery” is also off.

    Could you please add another PHP condition for “Use jQuery”?

    What do you mean by this condition? What should happen under which condition?

    These options are independent because of the various requirements on different blogs.

    Thread Starter Viktor Szépe

    (@szepeviktor)

    Use case:

    If someone disables “Use jQuery”
    Then do not output the snippet of js containing:
    jQuery( “#tag-groups-cloud-tabs” ).tabs();

    The option to turn off jQuery is for the (rare) case that someone uses his own jQuery code (for example he needs a different version, or he customized the code, or a theme already adds jQuery). So in these cases jQuery is working, but it comes from another source.

    People who are not familiar with it should probably simply leave the default settings. I think not much can go wrong – if one way doesn’t work, they just try the other. 🙂

    Thread Starter Viktor Szépe

    (@szepeviktor)

    I do understand that jQuery is available.
    But .tabs() is not.
    And in rare cases jQuery is avoided on special sites.

    On this page
    http://www.tamasidr.hu/kategoriak/eletmod-kategoriai/
    I’ve commented out

    jQuery( "#tag-groups-cloud-tabs" ).tabs();

    Try to execute it and watch to console!

    Please consider adding another PHP condition.

    You don’t seem to have the jquery-ui js and css (from the theme). I have added what was missing to the <title> section:

    <script type='text/javascript' src='//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js'></script>
    <link rel='stylesheet' id='tag-groups-css-frontend-theme-2-css'  href='//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/smoothness/jquery-ui.min.css' type='text/css' media='all' />

    and reactivated the jQuery().tabs()

    See the result at:
    http://www.christoph-amthor.de/test2.html

    EDIT: Links for other themes are available at http://blog.jqueryui.com/2013/05/jquery-ui-1-10-3/

    Thread Starter Viktor Szépe

    (@szepeviktor)

    Of course I do not have jquery-ui

    Your PHP condition prevents it from loading which is very well.

    if ($tag_group_enqueue_jquery) {
     wp_enqueue_script('jquery-ui-core');

    Please add this condition (if statement) to the js snippet also.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘jQuery error’ is closed to new replies.