jQuery duplicated prepended div when page refreshed??
$(function(){
$("#Form > form").submit(function(event){
event.preventDefault();
if($.trim($("textarea").val()).length!=0)
{
$.post("submit.php",{"text":$("textarea").val(),"page":"<?php echo $_GET['page']; ?>"},function(data){
$(data).hide().prependTo(".Display").slideDown("slow");
$("#Form > form")[0].reset();
});
}
});
});
Basically what I do is send data entered into a php page which inserts into a database and the data returned from the php echo is prepended into the div .Display... It works and a new div with the entered data slides down but if I refresh the page, it duplicates the div again and again on each refresh... The data in the database is shown in .Display when the page first loads using PHP... I just want to be able to submit and slide down a new div and not have it duplicate if the user refreshes, any idea?