Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter velikasha

    (@velikasha)

    Made it to work by slightly changing your code:

    wp_enqueue_script(
    			'wp-gallery-custom-links-js',
    			plugins_url( '/wp-gallery-custom-links.js', __FILE__ ),
    			array( 'jquery' ),
    			false,
    			true
    		);

    That error is gone now. Thanks for your help!

    Thread Starter velikasha

    (@velikasha)

    I have attempted to use the updated code, but the error is still there.

    Thread Starter velikasha

    (@velikasha)

    Well, actually I can’t since the site hasn’t launched yet. But I’ve commented out those lines to make IE8 work. Chrome was rendering the page, but there was still an error in the console log. This error is blocking rendering in IE8 completely:

    The value of the property ‘jQuery’ is null or undefined, not a Function object

    referring to this code:

    <script type="text/javascript">
    /* <![CDATA[ */
    jQuery(document).ready(function () {
    	jQuery('a.no-lightbox').unbind('click');
    	jQuery('a.no-lightbox').off('click');
    	jQuery('a.no-lightbox').click(wp_gallery_custom_links_click);
    	jQuery('a.set-target').unbind('click');
    	jQuery('a.set-target').off('click');
    	jQuery('a.set-target').click(wp_gallery_custom_links_click);
    });
    function wp_gallery_custom_links_click() {
    	if(!this.target || this.target == '')
    		window.location = this.href;
    	else
    		window.open(this.href,this.target);
    	return false;
    }
    /* ]]> */
    </script>

    That script is before the jquery defined on the page; I attempted to add a defer attribute to the script tag, but that hasn’t resolved the issue. Have you looked at possibly using wp_enqueue_script and then set a dependency for jquery ?

    Thanks for looking into this.

Viewing 3 replies - 1 through 3 (of 3 total)