Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2]

Author Topic: Ajax commenting with prototype  (Read 10474 times)


  • Hero Member
  • *****
  • Karma: 50
  • Posts: 940
Re: Ajax commenting with prototype
« Reply #15 on: September 25, 2007, 09:57:06 pm »

codetwist, well, I also didnt thought the one-file cms would be a problem or the rewrite thing, still, something is escaping from me.
I was experimenting and I managed to take a simple comment system and "ajaxify" it, everything works fine (well, with some minor bugs and the fact that it doesnt show at all in IE6 :-\)
and I do exactly the same with snews and it still doesnt work.
maybe, indeed, I should try mootols and quit on prototype.
Doh ... when You send something from ajax to snews.php then it's missing original reason for handling comments. Look  into function center() for this snippet:
Code: [Select]
switch(true) {
case isset($_POST['search_query']): search(); return; break;
case isset($_POST['comment']): comment('comment_posted'); return; break;
case isset($_POST['contactform']): contact(); return; break;
As You put it in first post - You get rid of comment button and that's end of story for default comment posting according to sNews ;)

If You want ajaxify it  - then You will have to either supply this POST variable or add new one and ensure that it's handled properly ;)


  • Sr. Member
  • ****
  • Karma: 12
  • Posts: 279
Re: Ajax commenting with prototype
« Reply #16 on: September 25, 2007, 11:37:21 pm »

So THAT is what I've been doing wrong... Thanks codetwist!

Vasile Rusnac

  • Newbie
  • *
  • Karma: 7
  • Posts: 49
Re: Ajax commenting with prototype
« Reply #17 on: September 26, 2007, 12:54:12 pm »

thx for the tip codetwist.
will have a look  8)
Pages: 1 [2]