Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Here $id comes from SQL after submit data
- <div class="comment'.$id.'"><ul>
- // new comment
- </ul></div>
- complete: function(data){
- var ID = $(this).attr('id').replace('comment','');
- $(".comment"+ID).append(data.responseText);
- $(".comment"+ID).fadeIn(2000);
- }
- $(".repfrm").click(function(){
- error.fadeOut();
- if(checkForm()){
- var author = inputAuthor.attr("value");
- var url = inputUrl.attr("value");
- var img = inputImg.attr("value");
- var replycom = inputReplycom.attr("value");
- var parent_id = inputparent_id.attr("value");
- var tutid = inputTutid.attr("value");
- $.ajax({
- type: "POST", url: "comment.php", data: "action=insert&author="+ author + "&replycom="+ replycom + "&url="+ url + "&img="+ img + "&parent_id="+ parent_id + "&tutid="+ tutid,
- complete: function(data){
- error.fadeOut();
- var ID = $(this).attr('id').replace('comment','');
- $(".comment"+ID).append(data.responseText);
- $(".comment"+ID).fadeIn(2000);
- });
- }
- });
- }
- else //alert("Please fill all fields!");
- error_message();
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement