Created
June 27, 2017 10:45
-
-
Save anonymous/ff64af9ca4302f5171fcced0f422fd41 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#ajax-action2").click( function() { | |
const AUTH_TOKEN = $("meta[name=csrf-token]").attr("content"); | |
request = $.ajax({ | |
type: "PATCH", | |
url: "/home/no_js_view_action", | |
headers: { | |
'X_CSRF_TOKEN': AUTH_TOKEN, | |
}, | |
dataType: "json", | |
data: { | |
some_data: {} | |
} | |
}).done(function( msg ) { | |
$( ".response-div" ).html( msg.data ); | |
}) | |
.fail(function() { | |
console.log( "error" ); | |
}) | |
.always(function() { | |
console.log( "complete" ); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment