jQuery on click event send POST request

Posted by Peterim on Stack Overflow See other posts from Stack Overflow or by Peterim
Published on 2010-05-01T21:16:31Z Indexed on 2010/05/01 21:17 UTC
Read the original article Hit count: 270

Filed under:
|
|

Trying to send POST request on click event using jQuery with no luck. Here is what I use:

    <script type="text/javascript">
        $('#taxi_update').click(
            $.ajax({
                'type':'POST',
                'data':'id=17446&chru=0',
                'success':function() { ... },
                'error':function(){ ... },
                'url':'/url/',
                'cache':false
            })
        );
    </script>
    <a href="#" id="taxi_update">update</a>

Unfortunately it doesn't send any POST request.

Any suggestions what could be wrong with this?

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about post