• Resolved physixfan

    (@physixfan)


    When I disable Autoptimize, this plugin works well. But if I enable Autoptimize, the click-and-expand function is broken. See my site for example: https://www.uscreditcardguide.com

    Autoprimize has an option to exclude specific js, which file should I exclude to make it working?

Viewing 13 replies - 1 through 13 (of 13 total)
  • If I were you, I would disable rocketscript and test that way ??

    (edit: at least it would allow one to see what JS is supposed to be active by adding ?ao_noptimize=1 to the URL. it looks like the eventhandlers aren’t applied to the categories now, but those event handlers are added by inline JS which is not optimized, so the chance is real this indeed is a rocketloader issue)

    Thread Starter physixfan

    (@physixfan)

    Thanks, I have disabled rocketscript. Now when I add ?ao_noptimize=1 to the url, the plugin works; when I don’t add the parameter, the plugin is broken. How can I see which JS is responsible for this function?

    well, give collapsFunctions.js a whirl (adding it to the comma-separated JS optimization exclusion-list I mean, while making sure js/jquery/jquery.js is also in there and the option “also aggregate inline JS” is not ticked) ??

    Thread Starter physixfan

    (@physixfan)

    I excluded the following:

    seal.js, js/jquery/jquery.js, webapp.js, collapsFunctions.js

    But the plugin still doesn’t work.

    Thread Starter physixfan

    (@physixfan)

    I checked “Also aggregate inline JS?” and now it works!

    great, but do keep an eye on your cache size; inline JS often (sometimes) has variable values which bust AO’s cache, leading to other problems. if that is the case, you’ll have to uncheck that options and (based on JS errors on your browser console) identify other JS to exclude.

    Thread Starter physixfan

    (@physixfan)

    OK… After I checked “Also aggregate inline JS?”, Disqus breaks down… Disqus is much more important to me, so the problem of this plugin still remains… ??

    well, without “aggregate inline JS” active, what JS errors (if any) do you see on the browser console?

    Thread Starter physixfan

    (@physixfan)

    Sorry I am really not an expert for this… I see something like this but I don’t know how to understand this information:

    Uncaught TypeError: jQuery(...).live is not a function
        at addExpandCollapse ((index):146)
        at (index):177
    addExpandCollapse @ (index):146
    (anonymous) @ (index):177

    and line 146 in index.php is:

    jQuery('#' + id + ' .expand').live('click', function() {

    Could you take a look at my site? It’s https://www.uscreditcardguide.com/en/

    • This reply was modified 8 years ago by physixfan.
    • This reply was modified 8 years ago by physixfan.
    • This reply was modified 8 years ago by physixfan.

    Sorry I am really not an expert for this… I see something like this but I don’t know how to understand this information:

    well, that’s a good start ??

    some googling taught me thatt jquery live() is a deprecated function since 1.7 and was removed in 1.9, so ideally @robfelty changes his code to use on() as shown on the same page to fix this.

    in the mean time (alternatively) you exclude js/jquery/jquery-migrate.min.js (which has as sole goal to “patch” things when old jquery functions are used) from JS optimization as well, that will likely fix the issue.

    hope this helps,
    frank

    Thread Starter physixfan

    (@physixfan)

    Wow, it works! You are really helpful!!!

    Thread Starter physixfan

    (@physixfan)

    I gave Autoptimize a 5 star rating !

    thanks physixfan ??

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘This plugin is broken by Autoptimize’ is closed to new replies.