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…
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…
Scheint zu klappen, sieht auch nett aus.
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.
ajax commenting?
yes I love this fuction , can you tell me , how to get it work in my theme?
thanks
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…
Lets see if this works.
We’re using AJAX quite heavily in http://www.openpsa.org
Cool effects here!
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?
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…
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).
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.
oK , may I know your comments .php files?
Nice job Nico. You could write a WP plugin and distribute it. It would be very popular!
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…
Looks great
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?
Sorry for spamming, but wanted to let you know that I got it working, thanks for the great scripts!
HTML-Test:
strong, em, link.
Testing Ajax comments. Cool stuff
Hm, mal schauen. Ajax faszniert mich schon seit einiger Zeit.
I disabled AJAX Commenting again. No need to post test comments anymore ;-)
wow its cool
yeah, it hangs
Seems to work
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,
Nico, not on your server. Ours! It posts but you need to refresh.
Pingback: Squible » Ajax Comments — How I did It
Very Cool. I am going to try this out. : )
Sorry, I have to try this out!
Got to try it myself :)
I guess I gotta get on the AJAX bandwagon
Nice commenting buddy !
中文測試
中文留言
The characters look good to me.
Nice, i will try it.
Wasssaaapp!!!
This is great :D
i like it
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.
中文留言測試
cool :D
kick ass !!
ajax commenting?
中文如何?
well, good works
Pingback: 窝子网志|WozLog » 站点改进:加强评论功能 改善参与体验
Giving the Ajax commenting system a whirllllllll
I can’t wait to use Ajax commenting for my next redesign
test
Mmmm AJAX
sdfjdfhgjkd
oh, this is how it works
Is the Ajax commenting still working?
testing, testing .. 1 .. 2 .. testing ;]
what if ..
what if ..
what if ..
2
test me pls
Großartige Seite… sehr informativ und lesenswert :)
Wirklich coole Idee!
Mmmh… sor richtig kommt das alles hier aber nicht mit der Kommentarzählung klar, oder?
testr