AJAX Comment Script mehrmals auf einer Seite

Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

  • AJAX Comment Script mehrmals auf einer Seite

    hallo ich habe dieses script

    planetsourcecode.com/vb/script…p?txtCodeId=2413&lngWId=8

    und eine webseite wo auf einer seite mehrere einträge sind ,ich möchte nun das dieses script für jeden einzelnen eintrag angezeigt bzw comments geschrieben werden können

    Quellcode

    1. $(document).ready(function(){
    2. $(".comment_table").find('textarea, input:text').blur(function () {
    3. if ($(this).val() != ''){
    4. $(this).removeClass("required");
    5. }
    6. });
    7. $("#submit").click(function(){
    8. var anyBlank = 0;
    9. $(".comment_table").find('textarea, input:text').each(function () {
    10. if ($(this).val() == ''){
    11. $(this).addClass("required");
    12. anyBlank = 1;
    13. }
    14. });
    15. if(anyBlank == "0")
    16. {
    17. var name = $("#name").val();
    18. var email = $("#email").val();
    19. var comment = $("#comment").val();
    20. comment = comment.replace(/\n\r?/g, '<br />');
    21. $("#loading").css("visibility","visible");
    22. $.ajax({
    23. type: "POST",
    24. url: "ajax_server.php",
    25. data: "name="+name+"&email="+email+"&comment="+comment,
    26. success: function(date_added){
    27. if(date_added != 0)
    28. {
    29. structure = '<div class="comment_holder"><div id="photo"><img src="images/user.gif" width="60" height="70"><br>'+name+'</div><div id="comment_text"><div id="date_posted">'+date_added+'</div>'+comment+'</div></div>';
    30. $(".no_comments").fadeOut("slow");
    31. $("#ajax_response").prepend(structure);
    32. $(".comment_table").find('textarea, input:text').each(function () {
    33. $(this).val("");
    34. });
    35. }
    36. else
    37. alert("Unexpected error...!");
    38. $("#loading").css("visibility","hidden");
    39. }
    40. });
    41. }
    42. });
    43. $("#ajax_response").mouseover(function(){
    44. $(this).find(".comment_holder").mouseover(function(){
    45. $(this).addClass("highlight");
    46. });
    47. });
    48. $("#ajax_response").mouseout(function(){
    49. $(this).find(".comment_holder").mouseout(function(){
    50. $(this).removeClass("highlight");
    51. });
    52. });
    53. });
    Alles anzeigen


    hatte das mal verdoppelt und den submit id eine 2 angehängt das geht aber nicht , dann funzt nix mehr

    Mfg