WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Thickbox doesn't work with W3 Total Cache (7 posts)

  1. candreu
    Member
    Posted 2 years ago #

    I have a problem with Thickbox and W3 Total Cache. When I active the minify JS, Thickbox doesn't work. I tried Auto Thickbox and Auto Thickbox Plus, and both have the same problem. Is there any way to active minify JS with Thickbox?

  2. johnflufin
    Member
    Posted 2 years ago #

    Are you using "Auto" Minify mode? (check W3TC General Settings in the Minify section) If so, try disabling Minify and clearing W3TC cache to see if this fixes Thickbox. If Thickbox is fixed, try "Manual" Minify mode.

    Auto Minify combines all javascript files it finds into one file. Some scripts won't work as intended when combined.

    Manual Minify allows you to choose which CSS and JS files to combine.

  3. attosoft
    Member
    Posted 2 years ago #

    Hi candreu,

    I'm the author of Auto ThickBox Plus plugin.

    I have a problem with Thickbox and W3 Total Cache. When I active the minify JS, Thickbox doesn't work. I tried Auto Thickbox and Auto Thickbox Plus, and both have the same problem.

    I tested W3 Total Cache with ThickBox, and found the following error has occured.

    Uncaught ReferenceError: thickboxL10n is not defined (thickbox.js)

    thickbox.js output the <script> tag before the closing <body> tag like bellow.

    <script type='text/javascript'>
    /* <![CDATA[ */
    var thickboxL10n = {"next":"Next >","prev":"< Prev","image":"Image","of":"\/","close":"Close","noiframes":"This feature requires inline frames. You have iframes disabled or your browser does not support them.","loadingAnimation":"http:\/\/example.com\/wp-includes\/js\/thickbox\/loadingAnimation.gif","closeImage":"http:\/\/example.com\/wp-includes\/js\/thickbox\/tb-close.png"};
    /* ]]> */
    </script>
    <script type="text/javascript" src="http://example.com/wp-includes/js/thickbox/thickbox.js?ver=3.1-20111117"></script>
    

    W3 Total Cache combines only <script src=""> tag. I think that text data inside <script> tag should be combined.

    Anyway, I modified Auto ThickBox Plus to be compatible with W3 Total Cache. Please reinstall latest version and try it after you empty caches.

  4. candreu
    Member
    Posted 2 years ago #

    Thank you, attosoft. I will update Auto ThickBox Plus and I retry to minify JS.

  5. candreu
    Member
    Posted 2 years ago #

    Sorry, but I updated Auto Thickbox Plus and it doesn't work with W3 Total Cache yet. I get the same error about thickboxL10n.

  6. attosoft
    Member
    Posted 2 years ago #

    Oh, I'm sorry. I updated thickbox.js but forgot to update thickbox.min.js.
    Please retry (delete and install) latest version.

  7. candreu
    Member
    Posted 2 years ago #

    Now it's right. Thank you!

Topic Closed

This topic has been closed to new replies.

About this Topic