I'm gonna declare this a caching bug.
I've tried every conceivable way of calling colorbox, using 4 or more techniques.
Colorbox ALWAYS works as expected if "Use speed-up tool for Javascript" function is disabled.
Colorbox FAILS to load if "Use speed-up tool for Javascript" is checked.
I have done the following:
1. loaded the colorbox script in
/common_files/customer/service_head.tpl
Code:
{load_defer file="lib/colorbox/colorbox.css" type="css"}
{load_defer file="lib/colorbox/jquery.colorbox-min.js" type="js"}
2. loaded colorbox ONLY on product detail pages, by putting an if around the js call:
Code:
{* BEGIN added by JR for COLORBOX js load on product pages *}
{if $main eq "product"}
{load_defer file="lib/colorbox/colorbox.css" type="css"}
{load_defer file="lib/colorbox/jquery.colorbox-min.js" type="js"}
{literal}
<script>
jQuery(document).ready(function () {
$(".iframe").colorbox({iframe:true, width:"50%", height:"60%"});
});
</script>
{/literal}
{/if}
{* END added by JR for COLORBOX js load on product pages *}
3. Tried putting it all into meta.tpl (no change)
4. Tried NOT using "load_defer" and simply used script/link code like the old days (tried this in service_head.tpl, meta.tpl, no change)
Code:
<script type="text/javascript" src="{$SkinDir}/lib/colorbox/jquery.colorbox-min.js"></script>
<link rel="stylesheet" type="text/css" href="{$SkinDir}/lib/colorbox/colorbox.css" />
No change.
5. I have manually deleted js and css cache from /var/cache
The bottom line: IF "Use speed-up tool for Javascript" function is disabled, colorbox will work, regardless of how we call it. If "Use speed-up tool for Javascript" function is enabled, colorbox will fail.
Either I am doing something dreadfully wrong, or there is something defective in this caching code.
Steve -- you mentioned
Quote:
There was similar issue with Flyout menus and cache so I would say this very well is the problem.
|
And I think you are on to something. I will share this with bugtracker.
Anyone else reading this using 4.4.x and adding js code -- PLEASE share your results!
Thanks,
J