Hi,
I'll just followup on my own statement.. I found the solution I was looking
for.
when calling $.ajax it has an event called error you can act on.

error: function( XMLHttpRequest, textStatus, errorThrown )

the XMLHttpRequest has a method called responseText which is the actually
text that the server outputs.. and this is what I wanted because all the
error information
about the php is there.

so basically just do an alert( XMLHttpRequest.responseText ) you will get a
dump of what
happend.

thanks,
Peter

On Sun, Jun 14, 2009 at 8:05 PM, MorningZ <morni...@gmail.com> wrote:

>
> I also deal with JSON almost exclusively (albiet in .NET, but getting
> the server side error would be the same)
>
> since $.getJSON doesn't handle error events, I wrote this simple
> wrapper around the $.ajax function
>
> GetAjax = function(url, params, success, error) {
>    var CallParams = {};
>    CallParams.type = "POST";
>    CallParams.url = url;
>    CallParams.processData = true;
>    CallParams.data = params;
>    CallParams.dataType = "json";
>    CallParams.success = success;
>    if (error) {
>        CallParams.error = error;
>    }
>    $.ajax(CallParams);
> }
>
>
> so now I could say:
>
> var Params = {};
> Params.ID = 4;
> Params.Name = "Steve";
>
> AjaxGet(
>     "some url",
>     Params,
>     function(json) {
>           //with success, 'json' is my result
>     }
>     function(x,y,z) {
>          //on error, x.responseText has the server error result
>     }
> );
>
> hope that helps
>
>
> On Jun 14, 12:31 pm, Peter Marino <marino.pe...@gmail.com> wrote:
> > Hi jQuery,
> > I'm using the $.ajax method and when this errors I react to the error
> event
> > within and dump
> > the XMLHttpRequest, textStatus, errorThrown to get an idea of what when
> > wrong... but
> > the most common message is "parse error" which doesn't help me that much.
> >
> > what is going wrong is that on the server side my php file has errors in
> it
> > and I would like
> > to see the errors on the client side.
> >
> > so basically is there a way to dump the result the server sends back that
> > $.ajax does not
> > know how to handle. btw: my $.ajax is setup to use json and this is
> probably
> > why it fails...
> > but I would like to see the result from the server.
> >
> > is this possible?
> > anyone?
> >
> > --
> > Power Tumbling -http://www.powertumbling.dk
> > OSG-Help -http://osghelp.com
>



-- 
Power Tumbling - http://www.powertumbling.dk
OSG-Help - http://osghelp.com

Reply via email to