I am pretty new to ajax,jquery and javascript. So need help. I have a form. When submit button is clicked the div below the form displays the result from the php file. What i want is that it should display the php file into that div as soon as the main page loads and the div refreshes when submit button is pressed.
<script>
$(document).ready(function() {
$('#form1').ajaxForm(function() {
$('#blogup').val(''); // alert("Thank you for posting!");
$("#display").load("showartposts.php")
});
});
</script>
Here, display is the div to be displayed on page load and when the form is submitted it should refresh this div to display new posts from showartposts.php. It is just like a facebook wall post thing. j
you need to try this :