Defer inline Javascript
-
The plugin works flawlessly but it gave me problems when I moved the loading of jQuery to the footer.
If I do that, this script is executed BEFORE of loading jQuery:
jQuery(document).ready(function(){ var q2w3_sidebar_1_options = { "sidebar" : "sidebar", "margin_top" : 10, "margin_bottom" : 0, "screen_max_width" : 1007, "width_inherit" : true, "widgets" : ['text-31'] }; q2w3_sidebar(q2w3_sidebar_1_options); setInterval(function () { q2w3_sidebar(q2w3_sidebar_1_options); }, 1500); });
I fixed it lowering the priority in q2w3-fixed-widget.php:57.
On the other hand, I have found this article which explains how to pass parameters to a external script (this way we wouldn’t need this inline script): https://ottopress.com/2010/passing-parameters-from-php-to-javascripts-in-plugins/
It would be great if you can add one of these changes ??
Thanks a lot!
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Defer inline Javascript’ is closed to new replies.