php and jquery, how to do an ajax call using 2 forms?
i am using this example to create a comment system. So far works great.
What i want to do is to add one more form that will insert comments in the database exactly like in that example just use another commentajax.php
witch ill rename to commentajax1.php
in where ill use a different sql statement.
i see the jquery POST $(".submit").click(function() {...}
works when a doom element with class="submit"
is activated. Will it be开发者_Python百科 enough to create another jquery that is called by another class?
thanks,
Look at this part:
$.ajax({
type: "POST",
url: "commentajax.php",
data: dataString,
cache: false,
success: function(html){
$("ol#update").append(html);
$("ol#update li:last").fadeIn("slow");
$("#flash").hide();
}
});
}return false;
});
It do AJAX to "commentajax.php".
If you create another click event that invoke different AJAX call to different url you will be fine.
精彩评论