• Resolved Jim

    (@jwmc)


    I recently started using Autoptimize (AO) and noticed several JS console error, like jQuery.js is not defined. I excluded that file from AO and the error disappeared.

    While checking for errors, I noticed all the pages with tables were just fine except for the page linked here. That page gives an error. I saw that jquery.datatables.min.js: was involved, so I excluded it from AO as well. But the error still occurs.

    At right of the error is: jquery.datatables.min.js:37:476 and the error is like this:

    Uncaught TypeError: n is undefined
        jQuery 12
            Ka
            R
            oa
            map
            map
            map
            oa
            e
            q
            each
            each
            q
        <anonymous> https://forestpathology.org/wp-content/cache/autoptimize/autoptimize_<random characters>.php:24
        jQuery 8
            i
            fireWith
            ready
            J
            promise
            <anonymous>
            <anonymous>
            <anonymous>

    I see in the page source that .js is from Tablepress:

    <script src='https://forestpathology.org/wp-content/plugins/tablepress/js/jquery.datatables.min.js?ver=1.12' id='tablepress-datatables-js'></script>
    <script type="text/javascript">
    jQuery(document).ready(function($){
    $('#tablepress-1').dataTable({"order":[],"orderClasses":false,"stripeClasses":["even","odd"],"pagingType":"simple"});
    });
    </script>

    I noticed, of all the pages with tables that I checked, this page is the only one that loads that .js file. The error occurs still with all other plugins disabled. Is the table corrupt or something? There are actually 3 tables on that page and I don’t know which might be the problem.

    After all this, I have to say the tables seem to display fine. Still, errors are wrong ?? Thanks!

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for your question, and sorry for the trouble.

    Unfortunately, your link is not working for me, I only get a “Forbidden” error?

    Regards,
    Tobias

    Thread Starter Jim

    (@jwmc)

    Oh sorry, I put the wrong URL. And there is something else wrong! I’ll come back when I have that issue fixed.

    EDIT: I don’t know what’s going on there. The page has a Referrer Policy header “unsafe-url”, and somehow that results in a 403 error.

    The actual URL is https://forestpathology.org/general/fungi/
    You may need to paste that into your browser to make it work if clicking the link still gives an error.

    • This reply was modified 4 years, 5 months ago by Jim.
    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    ah, indeed. When I copy/paste the URL, the page opens ?? You should definitely try finding that cause for the referrer policy, as you will be losing a lot of visitors otherwise, I would think.

    Now, regarding that JS error: The cause for this is that your table has combined/merged cells (via the #colspan# keyword) and has the “Use DataTables” checkbox checked. Unfortunately, these JavaScript features are not compatible to tables that have merged/combined cells. You will have to decide: Either uncheck the “Use DataTables” checkbox or remove all #colspan# from the table. Having both is not possible, I’m afraid.

    Regards,
    Tobias

    Thread Starter Jim

    (@jwmc)

    Thank you for the quick diagnosis. That’s an easy fix.

    You’re right, the Verboten error was a much more serious problem. Turns out I had some code to stop people hijacking images that wasn’t right. I cringe to think how long that was going on. I never thought to check links in other sites.

    Best wishes,
    Jim

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    good to hear that you were able to fix this ??

    Best wishes,
    Tobias

    P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!

    Thread Starter Jim

    (@jwmc)

    Funny, I didn’t remember I started a review 1 yr 3 mo ago and never finished it. When I clicked on your link it popped up ready to finish. Thanks so much.

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for that, I really appreciate it ??

    Best wishes,
    Tobias

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