views:

55

answers:

1

I put a breakpoint on the controller action but it never fires. Is there anyway to catch errors on a jquery post?

here is my jquery javascript code:

  <script type="text/javascript">
    $(document).ready(function() {

        $('#commitExerciseButton').live('click', function() {

            $.post($("#exerciseForm").attr('action'), $("#exerciseForm").serialize(), function(data) {

                $("#exercise").html("<h1>Exercise Added</h1>");
                $("#tabs-2").html(data);

            });
            return false;
        });
    });
</script>

EDIT:

I figured out the issue.. i had to do:

$("#exerciseForm Form").serialize() instead of $("#exerciseForm").serialize()

+3  A: 

if you can use $.ajax instead you can define an eror callback and see what is returning, also a tool like firebug for firefox are very usefull for seeing what is being posted, here is a link showing the ajax call and error callback

Pharabus
use the console in firebug
Pharabus