I have the following code:
$.ajax({
url: modal.href,
dataType: 'json',
type: 'POST',
data: modal.$form.serializeArray()
})
.done(onSubmitDone)
.fail(onSubmitFail);
TypeScript points to the $.ajax and gives a message saying:
Supplied parameters do not match any signature of call target.
However from what I can see my $.ajax is correct and I am correctly referencing the jQuery definitions. Can anyone suggest what might be wrong?
Referring to jquery.d.ts:
ajax(url: string, settings: JQueryAjaxSettings);
This is the signature of ajax function. You should move the url out of the settings object and pass in as a parameter instead for typescript to accept. Or edit the jquery.d.ts definitions to accept settings only function call.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With