script fancybox cdata in head
-
Hi
Today i deferred jquery and all other scripts. This works well.
There is one error – jQuery not defined – i receive from the cdata script, which is injected in the head by class-easyfancybox.php. Well, at least i guess, that this is the cause.I tried to add defer=”defer” in the <script> tag in class-easyfancybox.php, but the error persisted.
On another site, where i have the proversion installed, i used the same technique to load all the scripts and the cdata script does not appear in the head.
Is this due to the pro-version or is there a way to load or defer the cdata script, so it won’t show – jQuery not defined?Additional Info (how i deregister and dequeue all source files):
//remove fancybox style add_action('wp_print_styles', 'mytheme_dequeue_css_from_plugins', 100); function mytheme_dequeue_css_from_plugins() { wp_dequeue_style( 'fancybox' ); } add_action('wp_head','my_remove_fancybox_head',999); add_action('wp_footer','my_remove_fancybox_footer',999); function my_remove_fancybox_head() { wp_deregister_script('jquery-fancybox'); wp_deregister_script('jquery-easing'); wp_deregister_script('jquery-mousewheel'); wp_deregister_script('jquery-metadata'); wp_deregister_script( 'jquery-masonry' ); wp_dequeue_script('jquery-fancybox'); wp_dequeue_script('jquery-fancybox'); wp_dequeue_script( 'jquery-masonry' ); } function my_remove_fancybox_footer() { wp_dequeue_script('jquery-fancybox'); wp_dequeue_script('jquery-easing'); wp_dequeue_script('jquery-mousewheel'); wp_dequeue_script('jquery-metadata'); }
This works well, as long as i do not defer jquery.
Later on, i add my styles and scripts.Any idea how to remove the error when jquery is deferred?
Thanks
theo
- The topic ‘script fancybox cdata in head’ is closed to new replies.