I am trying to use the following code:
$('body').bind('ajaxSend', function (elm, xhr, s) {
if (s.hasContent && securityToken) { // handle all verbs with content
var tokenParam = "__RequestVerificationToken=" + encodeURIComponent(securityToken);
s.data = s.data ? [s.data, tokenParam].join("&") : tokenParam;
// ensure Content-Type header is present!
if (s.contentType !== false || options.contentType) {
xhr.setRequestHeader( "Content-Type", s.contentType);
}
}
});
I found this in the post Stack Overflow post
With typescript I get a syntax error on "options" saying "the name options does not appear in the current scope.
Can someone help and explain why I am getting this error. I see options is not declared and wonder where it comes from if it's not declared.