WordPress.org

Support

Support » Themes and Templates » [Resolved] Hovercards on self hosted theme issue

[Resolved] Hovercards on self hosted theme issue

  • I’ve been using gravatar hovercard code on my site.
    I noticed I get an error in IE with certain themes, 2010 weaver is one, for example.
    “Object doesn’t support this property or method line 331 char 3.” is the error.
    It works fine with twenty ten and on wordpress.com and webtoolscollection. I’m guessing it has something to do with java script conflicts, I’m totally lost in that area.

    http://ottopress.com/2010/gravatar-hovercards/ is the code I’m using.
    http://test.zeaks.org Is where I’m using it, no other plugins except for the recent comments are installed.

    Any help is appreciated.

Viewing 15 replies - 1 through 15 (of 31 total)
  • Moderator James Huff

    @macmanx

    Can you post the file that you’re using the code in on the pastebin, or are you using it as a plugin?

    Here it is in pastebin.
    http://wordpress.pastebin.com/JXhMyeeu

    I’ve also tried just using this in functions.php and had the same issue as with the plugin.
    http://wordpress.pastebin.com/dqee8Um5

    Moderator James Huff

    @macmanx

    Try instead (an older version of Otto’s code):

    <?php
    /*
    Plugin Name: Gravatar Hovercards
    */
    
    function gravatar_hovercards_jquery() {
    	wp_enqueue_script('jquery');
    }
    add_action('wp_enqueue_scripts', 'gravatar_hovercards_jquery');
    
    function gravatar_hovercards() {
    	echo '<script type="text/javascript" src="http://s.gravatar.com/js/gprofiles.js"></script>';
    }
    add_action('wp_footer','gravatar_hovercards');
    
    ?>

    Still causes the same error >.<

    Moderator James Huff

    @macmanx

    Can you paste the source output of your page when it’s finished load to the pastebin? I’m curious about what line 331 char 3 is.

    Sure, but what file do you want me to paste from? I’m using the plugin.

    Moderator James Huff

    @macmanx

    Activate one of the themes that’s giving you trouble and load http://test.zeaks.org/

    Then, view the source. In Chrome, that’s View/Developer/View Source, and in Firefox it’s View/Page Source.

    Now, copy that into the pastebin.

    Also, let us know which line and character the error references this time.

    ok, here it is http://wordpress.pastebin.com/yATtPNV0

    331 character 3

    Moderator James Huff

    @macmanx

    Line 331 is font-size: 1.2em; which would mean that char 3 is n, which really doesn’t seem like a problem to me.

    And everything is fine when you remove the hovercard code?

    yes everything is fine once I turn it off, no IE errors.

    Moderator James Huff

    @macmanx

    Are you using IE 8?

    yes, I’ve tried ie 9 before and it does the same thing for me

    Moderator James Huff

    @macmanx

    Ok, try just this:

    <?php
    /*
    Plugin Name: Gravatar Hovercards
    */
    
    function gravatar_hovercards() {
    	echo '<script type="text/javascript" src="http://s.gravatar.com/js/gprofiles.js"></script>';
    }
    add_action('wp_footer','gravatar_hovercards');
    
    ?>

    Still get an error in IE line 862 char 1, but it doesn’t work at all in FF with that code.

    Webpage error details

    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; Tablet PC 2.0)
    Timestamp: Thu, 14 Oct 2010 06:25:51 UTC

    Message: Object expected
    Line: 862
    Char: 1
    Code: 0
    URI: http://s.gravatar.com/js/gprofiles.js

    Moderator James Huff

    @macmanx

    That’s probably because your theme doesn’t enqueue jquery, so you’ll need the first half of that code. One more thing to try:

    <?php
    /*
    Plugin Name: Gravatar Hovercards
    */
    
    function gravatar_hovercards_jquery() {
    	wp_enqueue_script('jquery');
    }
    add_action('wp_enqueue_scripts', 'gravatar_hovercards_jquery');
    
    function gravatar_hovercards() {
    	echo '<script type="text/javascript" src="http://s.gravatar.com/js/gprofiles.js?g"></script>';
    }
    add_action('wp_footer','gravatar_hovercards');
    
    ?>

    (note the slightly different script URL)

Viewing 15 replies - 1 through 15 (of 31 total)
  • The topic ‘[Resolved] Hovercards on self hosted theme issue’ is closed to new replies.
Skip to toolbar