简体   繁体   English

在服务器上运行JavaScript并将DOM结果发送到客户端

[英]Run javascript on server and send DOM results to client

I've been stuck on this one for a while, so it's time to consult the pros. 我已经坚持了一段时间,现在是时候咨询专家了。 I've created a charting application that uses javascript to do heavy DOM manipulation/generation on the client (creating barcharts made of colored divs, etc). 我已经创建了一个图表应用程序,该应用程序使用javascript在客户端上进行繁重的DOM操作/生成(创建由彩色div等组成的条形图)。

Long story short, I want to avoid sending my js library to the client. 长话短说,我想避免将我的js库发送给客户端。 Is there any way to create the content on the server, using my existing javascript library, and only send the javascript-generated HTML to the client? 有什么方法可以使用我现有的javascript库在服务器上创建内容,并且仅将javascript生成的HTML发送给客户端?

Thanks for taking the time! 感谢您抽出宝贵的时间!

Node.js可能会做您想做的事,它已用于通过YUI3进行DOM操作

Try to convert your JavaScript DOM code to Java W3C DOM on ItsNat , for instance, take a look to this example . 尝试在ItsNat上将JavaScript DOM代码转换为Java W3C DOM,例如,看一下这个示例 Umm is based on Java not .Net. Umm是基于Java而不是.Net。

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

相关问题 客户端上的HTML按钮可在服务器上运行python脚本,然后将结果发送到客户端上的网页 - HTML button on client to run python script on server then send results to webpage on client 使用javascript将DOM对象发送到PHP服务器 - Send DOM object to PHP server with javascript 节点 JS - 将 function 本身发送到客户端,function 在客户端(不在服务器中)运行 - node JS - Send function itself to the client, that the function run in client (not in server) 服务器端函数调用客户端Javascript函数以获取结果 - Server Side Function Calling Client Side Javascript Function For Results JavaScript的客户端DOM开放重定向 - Client DOM Open Redirect for javascript 将捕获的图像从python服务器发送到javascript客户端 - Send captured images from python server to javascript client 如何将自定义标头从JavaScript WebSocket客户端发送到服务器? - How to send custom headers from JavaScript WebSocket client to the server? 从JavaScript客户端向SQL Server发送图像的最佳格式 - Best format to send image from javascript client to SQL server 使用客户端JavaScript将HTML快照发送到服务器 - Send html snapshot to server using client side javascript 通过javascript将JSON数据从客户端发送到服务器 - Send JSON data from client to server via javascript
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM