• Hello, I found only one topic with autoptimize. So it seems to work for most people. Unfortunately not for me.

    I had to exclude these two things in autoptimize to make it work:
    wp-includes/js/jquery/jquery.js, wp-content/plugins/osm/

    Otherwise JS errors would be visible in the console and the map would not appear.
    Can anyone confirm this problem?

    Cheers
    Frank

    • This topic was modified 3 years, 7 months ago by shoppa.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author MiKa

    (@photoweblog)

    Hello Frank,

    did you also try to exclude only the osm directory and not te jquery?

    Br, MiKA

    Thread Starter shoppa

    (@shoppa)

    Hello, sorry for late response.
    Problem for me is, if i exlude nothing the JS error means in frontend ol is undefined and in backend the map is not visible.

    In autoptimize is the checkbox for loading js in head unchecked.
    Only if i check this box it works. But you know scripts should better load before end body, not in head.

    Is there a way to load your js later?
    I mean the part with
    <script type=”text/javascript”>/** all layers have to be in this global array…

    If i only exclude osm (not jquery) then is jQuery undefined for this line:
    jQuery(document).ready(function(){jQuery('.generatedLink').click(function(){if(jQuery(this).data('map_name')==''){jQuery(this).data('map_name',jQuery(this).data('map'));}

    cheers
    shoppa

    • This reply was modified 3 years, 6 months ago by shoppa.
    • This reply was modified 3 years, 6 months ago by shoppa.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Problems with autoptimize’ is closed to new replies.