WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: W3TC] error when adding jquery.js to js file management (8 posts)

  1. ddeconin
    Member
    Posted 4 years ago #

    Hello,

    When I try to configure js file management by adding
    wp-includes/js/jquery/jquery.js to the default group 'embed in header' i get the following erros when I look at the page with google chrome developer tools.
    'Uncought SyntaxError: Unexpected token :'
    'Uncought ReferenceError: jQuery is not defined:'
    When I remove it again, everything is fine.

  2. Frederick Townes
    Member
    Posted 4 years ago #

    Make sure to try combine only setting and disable others.

  3. godkid
    Member
    Posted 4 years ago #

    I know this may sound a little silly, but:

    leaving jquery.js unminified entirely VERSUS adding it to the minification process (along with 8 or 9 JS files that minify fine), but choosing "combine only"

    Are the significant trade-offs? I'mhaving this problem currently with 4 files from wp-includes and just wondered

    =====

    Tested this - simply split scripts between header and footer and put the ones that were breaking in the minification in the header using Combine Only (header) setting, while leave those in the footer to be minified fully

  4. Frederick Townes
    Member
    Posted 4 years ago #

    Caching headers are set and compression is used.

  5. Erunafailaro
    Member
    Posted 3 years ago #

    This problem does also occur on my site and with W3TC 0.9.1.3. The minification of jquery.js seems to break the javascript of this library.

    However, the plugin Autopimize is able to combine and minify all .js-files, including jQuery.js, without problem.

    Is there another workaround except the "combine only"-option?

    Here are two of my websites. On one of them everything works fine. The other one generates the erroneous javascript-file. Both sites rely on the same jQuery.js file.

    • http://www.weinschenker.name/ - javascript works correctly, because option "combine obly" is checked.
    • http://java.weinschenker.name/ - javascript broken, because optione "combine obly" is not checked. Instead, comment- and linebreak-removal are active.
      • Javascript-debugger FireBug shows the following error: missing } after property list
  6. Frederick Townes
    Member
    Posted 3 years ago #

    I think I replied to a bug submission about this issue. Comment removal should not be used when minifying jquery.

  7. Erunafailaro
    Member
    Posted 3 years ago #

    Can't tag this thread as relsolved, although it is resolved as far as I am concerned.

  8. Frederick Townes
    Member
    Posted 3 years ago #

    Great. Anyone else?

Topic Closed

This topic has been closed to new replies.

About this Topic