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

Setting callback is mandatory, why? #25

Open
Frenchcooc opened this issue May 22, 2018 · 0 comments
Open

Setting callback is mandatory, why? #25

Frenchcooc opened this issue May 22, 2018 · 0 comments

Comments

@Frenchcooc
Copy link

Hi!

I'm getting an error when calling nanoajax.ajax() WITHOUT setting a callback function.

Code :

nanoajax.ajax({url:'/some-get-url'})

Error :

Uncaught TypeError: a is not a function
    at XMLHttpRequest.<anonymous> (nanoajax.js:2)

It may arrives that handling XHR response is not necessary. As a consequence, setting a callback should not be necessary.

A condition to check if a is a function would take some bytes, but be useful.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant