I've got the following code block in one of my pages ...
<?php if ($config->theme->short_name == 'default') { ?> <script type="text/javascript"> $('.error_box').html("Hmmm, there was an error while loading your theme. To stop everyone from looking silly I've loaded the default theme ... hope that's OK!"); </script> <?php } ?>
The conditional is being evaluated fine because I'm able to use window.alert without any problems. jQuery 1.5.1 is working as I'm also using jQuery Evolution (lightbox plugin) and that works fine, too. However, the element with class "error_box" doesn't get changed.
Shouldn't the code above set the .html property of the element with class "error_box" to the specified text? I've tried using an id instead of a class i.e. $('#error_box").html(...) but that doesn't work either. I've also tried using the .text() method.
Manually using document.getElementById("error_box") works without any problems - it's only jQuery that won't do what I tell it. :-)