简体   繁体   English

是否可以从后端请求 javascript 代码并在前端运行它?

[英]Is it possible to request a javascript code from the backend and run it on the frontend?

Hello to all the stackoverflow programmers, I want to open this thread to know if there is any possibility of being able to execute a javascript code that we request in the backend within the frontend.大家好,stackoverflow 程序员,我想打开这个线程来了解是否有可能在前端中执行我们在后端请求的 javascript 代码。 It's a pretty crazy idea and I've been thinking about it for a long time, it would be an api that returns a code that runs on the client.这是一个非常疯狂的想法,我已经考虑了很长时间,它会是一个 api 返回在客户端上运行的代码。 The question is.问题是。 Is this really possible?这真的可能吗?

If you are thinking about some dynamic code that can differ in each API requests response that perhaps you can use the eval function in javascript.如果您正在考虑在每个 API 请求响应中可能会有所不同的一些动态代码,也许您可以在 javascript 中使用eval function。

Refer this book for details详情请参阅本书

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 是否有可能在Haskell中编写后端并使用Javascript进行前端编写? - Is it possible to have backend written in Haskell and frontend with Javascript? 根据要求将 pdf 从后端传输到前端 jQuery - Transfering pdf from backend to frontend on request jQuery 前端请求到后端缺少参数 - Parameter Missing from frontend request to backend 从前端到后端的CORS策略阻止请求 - CORS policy blocking request from frontend to backend 请求 go 是从客户端到后端还是从前端到后端? - Will the request go from Client to backend or from frontend to backend? 将数据从后端(nodejs)传递到前端 javascript - Passing data from backend (nodejs) to frontend javascript 如何从前端脚本调用后端代码 - How to call backend code from frontend script 从 POST 请求读取 JSON 响应,在前端具有 JavaScript,在后端具有 Flask - Read JSON response from POST request, having JavaScript on frontend and Flask on backend JSON(仍然)是有效的 JavaScript 代码吗? 将对象从后端移动到前端 - Is JSON (still) a valid JavaScript code aka. moving objects from backend to frontend 是否可以在没有浏览器的情况下在后端运行JavaScript? - Is it possible to run JavaScript at backend without browser?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM