Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

ajax error

$.ajax({
    type: "post", url: "/SomeController/SomeAction",
    success: function (data, text) {
        //...
    },
    error: function (request, status, error) {
        alert(request.responseText);
    }
});
Comment

ajax jquery errors

$.ajax({
    url: 'some_unknown_page.html',
    success: function (response) {
        $('#post').html(response.responseText);
    },
    error: function (jqXHR, exception) {
        var msg = '';
        if (jqXHR.status === 0) {
            msg = 'Not connect.
 Verify Network.';
        } else if (jqXHR.status == 404) {
            msg = 'Requested page not found. [404]';
        } else if (jqXHR.status == 500) {
            msg = 'Internal Server Error [500].';
        } else if (exception === 'parsererror') {
            msg = 'Requested JSON parse failed.';
        } else if (exception === 'timeout') {
            msg = 'Time out error.';
        } else if (exception === 'abort') {
            msg = 'Ajax request aborted.';
        } else {
            msg = 'Uncaught Error.
' + jqXHR.responseText;
        }
        $('#post').html(msg);
    },
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: comparsion javascript 
Javascript :: destructure dynamic property 
Javascript :: speedtest-net node.js 
Javascript :: query selector has clas 
Javascript :: Get React Native View width and height 
Javascript :: how to check which key is pressed in jquery 
Javascript :: js make node with string 
Javascript :: how you can use javascript to play the sound for the button color selected 
Javascript :: how to fetch the all input element id value 
Javascript :: multidimensional array push in jquery 
Javascript :: javascript convert in a string the items of an array 
Javascript :: javascript check if object property exists 
Javascript :: mongoose check if string is objectid 
Javascript :: remove single item from array in angular 
Javascript :: reverse a date in javascript 
Javascript :: get value by name array from select in jquery 
Javascript :: if jsp 
Javascript :: javascript onclick image 
Javascript :: jquery set html of element 
Javascript :: how do i listen to a keypress in javascript 
Javascript :: dart list files in directory 
Javascript :: jquery get request with headers 
Javascript :: update style with javascript react components 
Javascript :: node command line input 
Javascript :: javascript array group by 
Javascript :: binary to int javascript 
Javascript :: javascript date add days 
Javascript :: javascript round down 
Javascript :: check if an object contains a value in javascript 
Javascript :: set url parameters javascript 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =