Is it possible to request JavaScript code from the backend and run it on the frontend?


Is there any possibility of being able to execute JavaScript code that we request in the backend within the frontend?

It’s a pretty crazy idea and I’ve been thinking about it for a long time. It would be an API that returns code that runs on the client. Is this really possible?

>Solution :

If you are thinking about some dynamic code that can differ in each API request’s response, then perhaps you can use the eval function in JavaScript.

Refer to this book for details.

Leave a ReplyCancel reply