Is it possible to use Q.js without node.js and require?

I am trying to use the latest q.js to add promises to my ajax calls. I do not use node.js in any form or form. I downloaded the latest from https://github.com/kriskowal/q and enabled only q.js. In my console, I see in some places:

ReferenceError: require not defined

I don't know if this is a transaction breaker or not, but I don't use requirejs either. I play with a single page application, and although I use jquery for ajax, I plan to remove this dependency for my own simple implementation or other smaller library. I want to use q.js and also use bootstrap.js and maybe use flatiron-director, what about that. Therefore, I do not use npm or any other material, since my application is so simple. With only a couple of JS files, I see no reason to add this complexity.

So the problem is that the problem and q.js will not work without require.js (or node.js)? I thought I read it separately, but when I see errors like this and it seems like it depends on some other JS libraries, I have doubts whether I can use it or not.

+4
source share
1 answer

Branch V2 of this project uses require.js. Branch V1 does not use require.js.
https://github.com/kriskowal/q/tree/v1

+6
source

Source: https://habr.com/ru/post/1527958/


All Articles