views:

53

answers:

6

I have a submit button when i click on that button i am having jQuery function which sends the Request to server side script

$('#submit_button').click(function(){
    $('#MYdialog').dialog('open');
    alert("Request Submitting");

    $.getJSON("test.php?stcode=<?php echo $this->stcode;?>",
        $("#myform").serialize(),
        function(data){
            $.ajaxSetup ({ cache: false});
            $('#MYdialog').dialog('close');

            alert(data);

            if ( data.num != null ) {
                window.open('print_test.php?stcode=01&no=' + data.num );
                window.location = self.location;
            }
        });
    }       
}); 

When i submit the request the mysubmit Dialog opened and running in loop. How do debug what is happening at server side script?

+3  A: 

I highly recommend FirePHP - it allows you to put out debug messages from your PHP code that don't alter your actual response: everything gets added to the headers.

mattdekrey
A: 

What language? If it's in asp.net you can just set a breakpoint in visual studio and trace through your server method.

David Lively
A: 

To debug and see what's going on in your php script you might need to use some debugger or debug technique . This topic is covered in several questions here in SO.

Matias
A: 

You must to add a breakpoint on the server side code, not client side only. The ability to debug on server side depends pretty much on your development environment (and I'm not talking about the IDE alone)

Thiago Santos
A: 

The success handler, I believe, will never get executed if there is a problem with the server. Also if you don't return proper JSON you will get a parser error, which means no success handler.

Gutzofter
A: 

Have you tried using Firebug in Firefox to see if it captures your call to your .php page? I use this a lot to get the "GET" calls that my site makes.

Jeff V