This should be a quick post for those that having problem with coComment, WordPress AJAX commenting, K2 with Live Commenting enable and probably others that are using AJAX goodies for submitting form.
After reading through coComment integrate page and cocomment.js, I found out that the culprit is the onSubmit event and it is the same event that triggers coComment when we submit the comment form. The current AJAX commenting code uses return false to stop a form from being submitted if there’s any error occur.
So basically if we want to use 2 onSubmit event, open comments.php and remove or delete return false; somewhere at the end of form tag (K2) right after parameters: Form.serialize(this)}); or in your AJAX comment JavaScript file. There’s probably a drawback (error indicator failed to work) but that should do it. Let me know if it’s working or not.
And yeah, if there’s any coComment staff reading this, please change my coComment blog title. Thank you in advance.
UPDATE: It seems that I need to reconfigure my coComment firefox extension preferences and untick ‘ignore unknown webpages (recommended)’ and manually set my blog Title since it does not automatically recognize my blog.
UPDATE 2: As far as I can tell, coComment recognize blog title that is using “-” and “»” but not k2 which uses “at” as title separator. Furthermore I remove my blog title when viewing single entry. Embedding the coComment WordPress code somewhere in your comment.php should force the variable to be properly inserted and set var cocomment_force to true (I think). No need to add cocomment.js.
PS: As far as I know, digg.com also suffers this same issue. And also coComment indeed does not work on WordPress.com in secure blogging mode (https).
This comment should be submitted to my coComment conversation page.
Thanks Zoe!
I’ll let the db folks know about correcting the blog title. That change will probably have to wait until tomorrow, though.
So does that mean that if I
open comments.php and remove or delete return false; somewhere at the end of form tag (K2) right after parameters: Form.serialize(this)});
then CoComment will work on K2 with the proper titles and everything?
thanks
Carl
I see, this allows you to use cocomment and have Ajax enabled.
Does not fix the title problem.
Carl
Carl, if you are talking about entry title do read UPDATE 2. If it’s regarding your blog title, then you have to ask coComment staff to update it for you.
Hey zeo, thanks for info, my site can run the cocomments although there are some bugs.
Testing coComment bookmarklet on non-embedding ajax-commenting blog…
Ok, *that* works :-)
@Zeo: your coComment blog title has been fixed.
Thanks a lot Chris and team for fixing my coComment blog title :)
malaysian있게 거만한
Hi,Zeo,so it means that if I change my K2 template following the step,just del “return false;”which after “parameters: Form.serialize(this)});” of “comment.php”,coComment will work properly with AJAX commenting enabled?
Well I followed this and everything looks fine:comment submiting without load the whole page,a popup window say that my comment has been sent to coComment while comment submitting.But my comment couldnt be shown unless I refresh the comment page.Furthermore,I cant find the comment on my conversations on coComment.
So did I miss something?
I have no idea. But this is what I use to force non-coCo user to use coComment without extension or bookmarklet.
<!-- coComment integration -->
<script type="text/javascript">
var blogTool = "WordPress";
var blogURL = "<?php echo get_option('siteurl'); ?>";
var blogTitle = "<?php bloginfo('name'); ?>";
var postURL = "<?php the_permalink() ?>";
var postTitle = "<?php the_title(); ?>";
<?php if ( $user_ID ) : ?>
var commentAuthor = "<?php echo $user_identity; ?>";
<?php else : ?>
var commentAuthorFieldName = "author";
<?php endif; ?>
var commentAuthorLoggedIn = <?php if ( !$user_ID ) { echo "false"; }
else { echo "true"; } ?>;
var commentFormID = "commentform";
var commentTextFieldName = "comment";
var commentButtonName = "submit";
var cocomment_force = false;
</script>
<script id="cocomment-fetchlet" trackAllComments="true" type="text/javascript" src="http://www.cocomment.com/js/cocomment.js"></script>
<!-- End coComment integration -->
I hope that they would do something with invalid trackAllComments=”true” attribute.
I can see the coComment field,I just cant send my comment to my coComment conversation,when I submitted,everything seems ok,a popup window show that my comment has been sent,but my conversation didnt receive anything.
This is actually not the ‘best practice’ to handle this. It would be much easier if someone could gone through the compressed cocomment.js and tell me what they put inside the onSubmit handler :P
What exactly is it, that you have in mind, Zeo? Basically, my current code overloads an exsiting onsubmit handler with one that first sends the comment to cocomment.com before the original onsubmit handler is called. What would you like to know and what is your plan?
Chris
Be careful where you put that cocomment code in your comments.php, or when you ping a site with a trackback you will send all of that with it.
Thanks for the work around on the ajax comments. The main reason I stopped using mine is because of coco.
Great, works for me!
But now does it work?