开发者

Is Jaxer a better solution than Node.Js

Since Jaxer has been around longer is it a better solution than Node.js if you are a developer like me who is new to programming with 开发者_C百科JavaScript on the server side?


Jaxer and node.js are very different things.

Think of Jaxer as Firefox running on the server side, but instead of a GUI, its interface to the outside world is Apache. It can do pretty much anything a browser on the client side can do: fetch pages from a third-party server, run JS against that page, pull elements from it via the DOM, substitute new content into it, etc.

Jaxer can also work more or less like ASP or PHP, simply executing JS inside special tags inside the HTML files Jaxer serves up via Apache, so that you can insert some dynamic content into those otherwise-static pages.

Jaxer has one huge disadvantage: it is dead technology.

node.js, on the other hand, is not a browser running on the server, it is very much alive right now, and it doesn't have any tie to Apache or any other standard web server.

You can build your own web server using node.js's HTTP component, but that brings on The Lisp Curse: because there is no standard web server, everyone builds theirs a different way, so that there is no concentrated expertise on the subject.

The same goes for templating and other things that go into an ASP or PHP type platform: no complete, built-in component means you end up assembling your own from the provided pieces.

This makes node.js best suited for projects where you were already going to have to reimplement everything yourself, so what you want is a box of tools and components, rather than a "platform." If you can fairly describe your project as a web app, meaning that it's an application that just happens to show its UI via the web, and most of its content is dynamically-generated rather than being served from files, node.js might be a fine choice.

If instead you just need to substitute some dynamic content into a mostly static presentation, well, I cannot really recommend Jaxer, but something like it that plugs into a standard web server is a better choice.


Despite both using JavaScript as the language, Jaxer and Node.js achieve two different goals. Jaxer appears to be targeted as a server-side Web scripting language (like PHP or ASP.NET), whereas Node.js is more of a general-purpose event-driven network server framework that happens to be able to serve Web pages.

Which solution you should choose hinges entirely upon what you're trying to do. If you can expand upon your question with your goals for server-side JavaScript, then we can provide better suggestions as to what to use.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜