Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function GetData() {
- $.ajax({
- type: "POST",
- url: "/api/MyData",
- headers: headers,
- contentType: "application/json",
- data: JSON.stringify(params),
- success: function (result) {
- $("#result").html('');
- $("#result").html(result.somedata);
- },
- error: function (error) {
- if (error.statusText == "Unauthorized") {
- Refresh(); //Refresh access token
- GetData(); //Call this function again to get data while authenticated
- }
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement