View Single Post
Old 05-24-2011, 09:52 PM   PM User | #2
DanInMa
Senior Coder

 
DanInMa's Avatar
 
Join Date: Nov 2010
Location: Salem,Ma
Posts: 1,335
Thanks: 13
Thanked 207 Times in 207 Posts
DanInMa is on a distinguished road
you doing things the hard way.

- here's some info on error handling as well - http://www.maheshchari.com/jquery-ajax-error-handling/

Code:
$(document).ready(function () {
var datastring= $("#form").serialize();
    $("#form").submit(function (event) {
        event.preventDefault();
        $.ajax({
            type: "post",
            dataType: "html",
            url: 'mail.php',
            data: datastring,
            success:function(html){
           $("#results").html(html);
}
        });
    });
});
__________________
- Firebug is a web developers best friend! - Learn it, Love it, use it!
- Validate your code! - JQ/JS troubleshooting
- Using jQuery with Other Libraries - Jslint for Jquery/other JS library users

Last edited by DanInMa; 05-24-2011 at 09:56 PM..
DanInMa is offline   Reply With Quote