点击时ajax功能和点击功能不起作用

I have no idea what's wrong with my code to call another PHP file via jQuery.ajax function. Need some help in identifying the error.

$('#submit').click(function(event){
         event.preventDefault();
         do_cart();
     });

     function do_cart(){
         alert('testing');
         $.ajax({
             url:'doCartupdate.php',
             success:function(){
                 alert('Success.');
                 $('#form').submit();
             }
         });
     }

Do I miss anything here? I have no need to pass data over to the PHP file, I just need the function inside the PHP file get called.

edit 2: now I required some alert boxes.

     <script type ="text/javascript">
        $('#submit').live('click',function(event){
            //event.preventDefault();
            do_cart();
            alert('Ridirecting to paypal');
        });

        function do_cart(){
            alert('please wait');
            $.ajax({
                url:'doCartupdate.php',
                success:function(){
                    alert('Success.');
                    //$('#form').submit();
                }
            });
        }
    </script>

It would be good if I can reduce the box to only 1 or none.

It works for me.

http://sandbox.phpcode.eu/g/8ed34.php

be sure you put this script AFTER definition of #submit or be sure you put

your code to

$(function(){
    //yourcode
});

Try $('#submit').live('click', function(event){...

Change this

$('#submit').click(function(event){
         event.preventDefault();
         do_cart();
     });

To

$('#submit').click(function(event){
         do_cart();
         event.preventDefault();
     });