Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1292491
    Eppu
    Participant

    Hi,

    We think there’s a little problem with X Theme’s x-body.js. The non-minimized version includes section “Setup ScrollSpy Functionality”. When the document is ready it reads whatever hash index there is at the end of the URL and uses this with jQuery. We are using X Theme and WP Job Manager. WP Job Manager adds “#s=1” to the URL when user chooses criterias for the search functionality and that is WP Job Manager special. However, the code in x-body.js reads that also and tries to use it with jQuery, but that gives syntax error of “Syntax error, unrecognized expression: #s=1”. Obviously a “=” character is not valid expression for index. And because of this error the WP Job Manager stops working. The code part where this occurs is:

    //
    // Page load offset (if necessary).
    //

    $(window).load(function() {
    if ( locHashIndex !== -1 && $(locHash).length ) {
    animateOffset(locHash, 1, ‘linear’);
    }
    });

    And there that “$(locHash).length” is where the error occurs if locHash contains expression in invalid format.

    This same error also occurs on your site if you add “#s=1” to the end of the URL: https://theme.co/x/#s=1 Then check from the browser console for the error message.

    Could you add some kind of escaping for this so that it would check that the hash index expression in the URL is valid format and if not, it will just ignore the functionality? After all this is a value coming from browser, which should be escaped. Right now this error breaks other functionality on our site.

    #1292663
    Christian
    Moderator

    Hey there,

    I’ll forward this to our development team. Please stay tuned.

    Thanks.

    #1297810
    Eppu
    Participant

    Any update on the situation? I would like to go online with the job list but I can’t because of the bug.

    #1297854
    Christian
    Moderator

    Sorry but we do not have an update for this yet. Please stay tuned.

    Thanks.

  • <script> jQuery(function($){ $("#no-reply-1292491 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>