depends; is that block of JS-code inlined in the output HTML? or is the php-file referenced?
frank
You know i am really not sure… The entire file code is:
<?php $messages = Inventor_Utilities::get_messages(); ?>
<?php if ( ! empty( $messages ) && is_array( $messages ) ) : ?>
<div class="alerts">
<?php foreach ( $messages as $message ) : ?>
<div class="alert-primary alert alert-dismissible alert-<?php echo esc_attr( $message[0] ); ?>">
<div class="alert-inner">
<div class="container">
<?php echo wp_kses( $message[1], wp_kses_allowed_html( 'post' ) ); ?>
<button type="button" class="close" data-dismiss="alert"><i class="fa fa-close"></i></button>
</div>
</div><!-- /.alert-inner -->
</div><!-- /.alert -->
<?php endforeach; ?>
</div><!-- /.alerts -->
<script>Cookies.remove('messages');</script>
<?php endif; ?>
This does not work btw: <!–noptimize–> <script>Cookies.remove(‘messages’);</script> <!–/noptimize–>
-
This reply was modified 7 years, 1 month ago by kappler0.
OK, can you share your URL so I can have a quick look?
https://equinerising.com
(you will prob need to register to see it)
thx!
-
This reply was modified 7 years, 1 month ago by kappler0.
well, don’t see that JS even with AO disabled (add ?ao_noptimize=1
to the URL) but that might be because I’m not logged in?
but did you try adding plugins/inventor/
to the JS optimization exclusion list (as your PHP-snippet mentions Inventor_Utilities
?
frank
hi, so i tried adding the plugin /inventor but still no luck.
i did see this with chrome inspector:
Uncaught ReferenceError: Cookies is not defined
at autoptimize_7b4b5bc….js:1998
thx,
Scott
well, it does confirm we’re getting closer 🙂
there’s plugins/inventor/libraries/js.cookie.js
which should already be excluded, but also plugins/inventor-google-map/libraries/js-cookie.js
, so add plugins/inventor-google-map/
to the exclusions maybe?
have a nice weekend!
frank