AJAX Commenting

13. Juli 2005

I’m testing some eye-candy on the comments page of this site these days. Using AJAX, based on Prototype.

Update: This is how it works, but remember it’s a hack, not a solution…

60 Kommentare

  1. Scheint zu klappen, sieht auch nett aus.

  2. ja, es klappt – hat aber noch einen kleinen fehler, so wie ich das sehe. wenn ein neuer kommentar hinzugefügt wird, steht links vom kommentar eine „1“, unabhängig davon welcher beitrag es ist. war jedenfalls bei meinem vorherigen kommentar der fall.
    erst beim reload wird die zahl aktualisiert.

  3. des das dem das

    ajax commenting?

  4. yes I love this fuction , can you tell me , how to get it work in my theme?

    thanks

  5. Drop these files into your theme directory.

    ajax_comments.php handles the AJAX requests and acts just like wp-comments-post.php from WordPress.

    ajax_comments.js is the JavaScript part that sends AJAX requests and updates the page. You have to adjust this file to match your style ids! And the comments ol tag must be present for this to work, even if it’s empty..

    Then, you have to drop some Scripts from script.aculo.us in the „scripts“ directory (see the header of this page) and add them to the page header. And last, but not least, add this to the form tag of you style’s comments.php:

    onsubmit="new Ajax.Updater({success:'commentlist'}, '/wp-content/themes/mytheme/ajax_comments.php', {asynchronous:true, evalScripts:true, insertion:Insertion.Bottom, onComplete:function(request){complete(request)}, onFailure:function(request){failure(request)}, onLoading:function(request){loading()}, parameters:Form.serialize(this)}); return false;"

    This is not very clean and nice, I know, and this was never meant for distribution, at least for this version. Maybe I’ll clean it up some day and write a better guide…

  6. Lets see if this works.

    We’re using AJAX quite heavily in http://www.openpsa.org

  7. Cool effects here!

  8. yes , thanks you for the hack but I still can not implemeted it into my themes, I dont know why , but I have stupid question : are prototype need ruby hosting support?

  9. Bergie: The effects are from script.aculo.us, a very nice JavaScript library (together with the great Prototype framework)…

    I don’t know if this works with all browsers, it does work with JavaScript disabled, but it does not work with Opera 7.xx e.g. It’s as broken as the Ruby on Rails based Typo weblog engine…

  10. kusaeni: No, Prototype and script.aculo.us are JavaScript libraries that run on the client’s browser, so no need for Ruby support on the hosting site. You just need to copy the two js files into the scripts/ folder (you can copy (not hotlink!) them from my site for example).

  11. thanks Nico , was follow your instructions , but still have problems.

    After type a comment text , the page is loading so far , and the comments is not appear in comment list . But when I reloaded the page , comments is appear , normaly .

    How I can solving this troble?

    thanks , and sorry for my english .
    I am Indonesian.

  12. oK , may I know your comments .php files?

  13. Nice job Nico. You could write a WP plugin and distribute it. It would be very popular!

  14. I guess packaging it as a WP plugin would not work well, because it would depend on specific class names, list id’s (for the comment list) and e.g. the fact, that the empty comment list has to be present even if there is no comment yet.

    Inevitably the plugin would break on several themes…

  15. Looks great

  16. Ok, I have a small problem. I got it pretty much working, except when you post a comment, nothing happens until you refresh the page, then it is there… Any ideas?

  17. Sorry for spamming, but wanted to let you know that I got it working, thanks for the great scripts!

  18. HTML-Test:

    strong, em, link.

  19. Testing Ajax comments. Cool stuff

  20. Hm, mal schauen. Ajax faszniert mich schon seit einiger Zeit.

  21. I disabled AJAX Commenting again. No need to post test comments anymore ;-)

  22. wow its cool

  23. yeah, it hangs

  24. Seems to work

  25. i figured it out. I was so stupid. bet all of you are having the same problem.
    make sure to change:
    ‚/wp-content/themes/mytheme/ajax_comments.php‘, {asynchronous:true,

  26. Nico, not on your server. Ours! It posts but you need to refresh.

  27. Very Cool. I am going to try this out. : )

  28. Sorry, I have to try this out!

  29. Got to try it myself :)

  30. I guess I gotta get on the AJAX bandwagon

  31. Nice commenting buddy !

  32. 中文測試

  33. 中文留言

  34. The characters look good to me.

  35. Nice, i will try it.

  36. Wasssaaapp!!!

  37. This is great :D

  38. i like it

  39. Why the chinese characters in this blog no need to refresh in order to prevent to display rubbish characters?

    This problem is related to MySQL version? Collation of database or tables?

    The following wordings are Chinese characters.

    中文留言測試

  40. cool :D

  41. kick ass !!

  42. ajax commenting?
    中文如何?

  43. well, good works

  44. Giving the Ajax commenting system a whirllllllll

  45. I can’t wait to use Ajax commenting for my next redesign

  46. test

  47. Mmmm AJAX

  48. sdfjdfhgjkd

  49. oh, this is how it works

  50. Is the Ajax commenting still working?

  51. testing, testing .. 1 .. 2 .. testing ;]

  52. what if ..

  53. what if ..
    what if ..
    2

  54. test me pls

  55. Großartige Seite… sehr informativ und lesenswert :)

  56. Wirklich coole Idee!

  57. Mmmh… sor richtig kommt das alles hier aber nicht mit der Kommentarzählung klar, oder?

  58. testr

Auf anderen Seiten

Kommentare für diesen Beitrag sind derzeit deaktiviert.