jQWidgets Forums

jQuery UI Widgets Forums Getting Started I need ajax call to show the php problem

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 11 years, 11 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author

  • stevewp
    Participant

    Below is a common call that I am using in javascript to perform some SQL operation on the server.  When the data.php script encounters an error (syntax, sql syntax),  I don’t know how to display there was a problem when php reports a problem.  How does one display the php error in the ‘error’ part of the php call?

    steven

     

     

    $.ajax({
    dataType: ‘json’,
    url: ‘data.php’,
    data: data,
    cache: false,
    success: function (data, status, xhr)
    {
    // insert command is executed.
    commit(true);
    },
    error: function (jqXHR, textStatus, errorThrown)
    {
    commit(false);
    }
    });


    Peter Stoev
    Keymaster

    Hi,

    If the Ajax call fails, the error callback of the jQuery’s Ajax function will be called. The errorThrown parameter will contain the error information.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.