WordPress.org

Support

Support » Plugins and Hacks » WP Ajaxify Comments » [Resolved] [Plugin: WP-Ajaxify-Comments] Unable to Post Comments after Recent Update

[Resolved] [Plugin: WP-Ajaxify-Comments] Unable to Post Comments after Recent Update

  • Today I just noticed that I wasn’t able to post a comment using this plugin, it kept getting a JS error provided below (this was on the Rockmelt browser, similar to chrome):

    jquery.min.js:4 Uncaught TypeError: Cannot read property ‘style’ of undefined

    After further investigation, i noticed that the beginning of the function wpac_showMessage had jQuery('#wpadminbar'), for me I turned this off so this element was not available therefore throwing the above error. What I did was changed

    var top = wpac_options.popupMarginTop + jQuery("#wpadminbar").outerHeight();

    to

    if(jQuery('#wpadminbar').length > 0)
    		var top = wpac_options.popupMarginTop + jQuery("#wpadminbar").outerHeight();
    	else
    		var top = wpac_options.popupMarginTop;

    and now it works fine. Just wanted to give you a heads up just in case other people were wondering about this error.

    http://wordpress.org/extend/plugins/wp-ajaxify-comments/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author janjonas

    @janjonas

    Hi,

    thanks for your feedback.

    When I’m not logged in the #wpadminbar element is not available. However (even if the element ist not available) in my installation jQuery(‘#wpadminbar’).outerHeight() returns null and does not throw an exception.
    For me this also works in the Rockmelt browser.

    Which jQuery version are you using?
    You find the jQuery version info in the console when you enable the plugin’s debug mode or by evaluating jQuery.fn.jquery in the console. To enable the console press F12 to open the browser’s developer tools.

    Regards,
    Jan

    Jan,

    Thanks for the quick response the version of jquery i have is 1.7.2

    Thanks!

    Kiko

    Plugin Author janjonas

    @janjonas

    Hi Kiko,

    Unfortunately I’m not able to reproduce your problem. I updated to jQuery 1.7.2 and everything works fine; even if the admin panel is not available jQuery(“#wpadminbar”).outerHeight() returns null.

    I think there is an incompatibility with your theme or any other plugin on your site. Is your blog public available? I would like to find the cause of the problem?

    Regards,
    Jan

    Jan,

    It’s at Yeewiz.com i have reverted my change and turned on debug mode for you.

    Thanks!

    kiko

    Plugin Author janjonas

    @janjonas

    Hi kiko,

    Thanks for the link. I think I found the problem:
    Your blog includes the waitForImages JavaScript library in version 1.3. I was able to reproduce your problems when including this JavaScript file in version 1.3. After updating to the most recent version 1.4 of the library (https://raw.github.com/alexanderdickson/waitForImages/master/jquery.waitforimages.js) the problem was solved and jQuery(“#wpadminbar”).outerHeight() returns null.

    I would recommend to either update this script manually or contact the author of the plugin that includes this script in your site and ask him to update to waitForImages 1.4.

    Best regards,
    Jan

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] [Plugin: WP-Ajaxify-Comments] Unable to Post Comments after Recent Update’ is closed to new replies.
Skip to toolbar