Skip to content

Category: Questions

Javascript ES6 Syntax Radio button check

I have been trying to convert my code using the ES6 syntax and wondering why are my form’s radio and checked buttons not registering as true when check. I still get the error message even if a user selects one of the choices? Could you please help me with what I’m doing wrong so I can better under…

Uncaught TypeError: work.filter is not a function

I can’t seem to figure out why I am getting this error when running the filter method on an array (imported from a separate file) anyone have any ideas? This is my first question on here and I’m reasonably new to writing code, so you may need more context 🙂 let me know if so! Thanks for any help! …

Jinja2, JavaScript and CSP

I’ve been studying Flask and Jinja2 for a while now, and I notice that all the books and tutorials I’ve found put {% block js %} after {% block body %}. This appears to violate CSP which, as I understand it, dictates that all javascript code be in external files and that the <script> tags wh…

Is it possible to receive http requests using vanilla js?

The title says it all. Is it possible to receive http requests using vanilla JS? I know the fetch API allow me to send them, but, as far as I know, there’s no way to receive them. If there is, how? Jquery? Answer JS itself has no mechanisms for input and output. It depends on the host environment to pro…

.toPromise() and lastValueFrom() in rxjs

I have this observable I call it with .toPromise() is deprecated, so I would like to change the call with lastValueFrom(): but I receive the following error: UPDATE: for now, resolved with: but is there a better solution? Answer Is there a better solution? Yes and no. In your case mergeMap(_ => EMPTY) will…

Unhandled Promise Rejection Warning Error

ERROR (node:39756) UnhandledPromiseRejectionWarning: Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client at ServerResponse.setHeader (_http_outgoing.js:561:11) at ServerResponse.header (C:UserselegmOneDriveРабочий столanimflexapinode_modulesexpresslibresponse.js:771:10) at Serv…