0

There are 50 images on which you can Add / Delete comment , Which is a better way for implementation ?

1) Create an individual form for each image . Add the data to form and post it ? (50 forms would be created & 50 for deleting i think )

2) Use Jquery to select the text from the text box and ID and then post it using Ajax ?

I think the site

http://pinterest.com/

is using Approach 1 and

Facebook

us using Approach 2 ? Which one is better ?

2
  • 1
    I used to use the second way. Commented May 10, 2012 at 17:17
  • @RicardoLohmann -Would it be possible if you could share some tutorial for this approach ? Thanks Commented May 10, 2012 at 18:54

2 Answers 2

1

I would use the second approach, it's more modern and you don't have to reload the page for an action.

But this is not a question with an definitive answer, because both ways will work fine.

Update: This is a tutorial for deleting a comment http://papermashup.com/jquery-ajax-delete/

With adding one it's basicially the same approach, but you send the referencing image id and the comment text.

Sign up to request clarification or add additional context in comments.

1 Comment

Would it be possible if you could share some tutorial for this approach ?
0

For method 2, something like this will work:

//LISTEN FOR YOUR SUBMIT COMMENT BUTTON TO FIRE
$("#commentButton").live('submit', function(e) {

    //GET COMMENT
    com = $("#commentField").text();

    //POST COMMENT
    $.post("commentsystem.php", { user: user, comment: com} );

});

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.