post to page with jQuery and read response

Posted by wcpro on Stack Overflow See other posts from Stack Overflow or by wcpro
Published on 2010-04-14T16:22:53Z Indexed on 2010/04/14 16:23 UTC
Read the original article Hit count: 343

Filed under:
|

I'm trying to post to a form using jQuery and read the results of the posted page. I have created a super simple example.

    $('#submit').click(
        function () {
            $.get('post.htm',
                {
                    demo : "true"
                },
                function (data) {
                    alert('data load: ' + data);
                },)
        });

the html page for post.html is just a simple html form

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
</head>
<body>
this is a post
</body>
</html>

© Stack Overflow or respective owner

Related posts about jquery-ajax

Related posts about jQuery