Advertisement
Guest User

Untitled

a guest
Nov 29th, 2014
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. // Here $id comes from SQL after submit data
  2. <div class="comment'.$id.'"><ul>
  3.  
  4. // new comment
  5.  
  6. </ul></div>
  7.  
  8. complete: function(data){
  9. var ID = $(this).attr('id').replace('comment','');
  10. $(".comment"+ID).append(data.responseText);
  11. $(".comment"+ID).fadeIn(2000);
  12. }
  13.  
  14. $(".repfrm").click(function(){
  15. error.fadeOut();
  16. if(checkForm()){
  17. var author = inputAuthor.attr("value");
  18. var url = inputUrl.attr("value");
  19. var img = inputImg.attr("value");
  20. var replycom = inputReplycom.attr("value");
  21. var parent_id = inputparent_id.attr("value");
  22. var tutid = inputTutid.attr("value");
  23.  
  24. $.ajax({
  25. type: "POST", url: "comment.php", data: "action=insert&author="+ author + "&replycom="+ replycom + "&url="+ url + "&img="+ img + "&parent_id="+ parent_id + "&tutid="+ tutid,
  26.  
  27. complete: function(data){
  28. error.fadeOut();
  29. var ID = $(this).attr('id').replace('comment','');
  30. $(".comment"+ID).append(data.responseText);
  31. $(".comment"+ID).fadeIn(2000);
  32.  
  33.  
  34. });
  35. }
  36. });
  37. }
  38. else //alert("Please fill all fields!");
  39. error_message();
  40. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement