Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$.load should handle error case #75

Open
dixonsiu opened this issue Feb 7, 2018 · 0 comments
Open

$.load should handle error case #75

dixonsiu opened this issue Feb 7, 2018 · 0 comments

Comments

@dixonsiu
Copy link
Member

dixonsiu commented Feb 7, 2018

Currently it is assumed that it always return successfully. But sometimes, when it fails, the spinner does not stop.

Example for how to handle error.

    <script>
    $( "#success" ).load( "/not-here.php", function( response, status, xhr ) {
      if ( status == "error" ) {
        var msg = "Sorry but there was an error: ";
        $( "#error" ).html( msg + xhr.status + " " + xhr.statusText );
      }
    });
    </script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant