这有解决方案吗?如果我将通过ajax调用一些web服务,那么客户端将有延迟.如果它将在JS中,则无法从PHP或Java等中访问它.如果我在PHP中使用其他语言的某些服务,那么这也可能成为性能问题.
也有一段时间我们需要使用db或没有db从某些参数输出这些函数作为输入.
我知道会有一些非常简单的解决方案,但我不知道.请告诉我一些语言无关的解决方案,因为我总是没有VPS.
我不确定我的问题是否实际上属于stackoverflow.com或programmers.stackexchange.com所以请将它转移到programmers.stackexchange.com而不是关闭这个问题,如果它属于那里.
解决方法
Node.js允许您使用JavaScript编写服务器端代码.
Node.js is a platform built on Chrome’s JavaScript runtime for easily building fast,scalable network applications. Node.js uses an event-driven,non-blocking I/O model that makes it lightweight and efficient,perfect for data-intensive real-time applications that run across distributed devices.
@H_502_19@您还可以使用JavaScript为移动设备编写HTML5应用程序.
“Building iPhone Apps with HTML,CSS,and JavaScript”
Now web designers and developers can join the iPhone app party without having to learn Cocoa’s Objective-C programming language. It’s true: You can write iPhone apps quickly and efficiently using your existing skills with HTML,and JavaScript. This book shows you how with lots of detailed examples,step-by-step instructions,and hands-on exercises.
@H_502_19@如果您不想尝试在JavaScript中编写大型复杂应用程序,GWT提供了编写Java和通过翻译的方法,在客户端上运行它.
The GWT SDK contains the Java API libraries,compiler,and development server. It lets you write client-side applications in Java and deploy them as JavaScript.
@H_502_19@如果您使用.Net语言开发:C# – > JavaScript ScriptSharp
Script# is a free tool that enables developers to author C# source code and subsequently compile it into regular script that works across all modern browsers
@H_502_19@