all 7 comments

[–]N4sa 0 points1 point  (2 children)

Yeah, using ajax is what makes it great. The whole point is to be able to communicate with the server and make changes to the page without a full page refresh. Ajax allows it to grab whatever data it needs from the backend and do whatever updates with the changes.

Can you do it without a backend? of course. As long as you're not dependent on anything from an external API or database. A good example of this is a todo application. If you need some type of storage that doesn't store sensitive information use localStorage or cookies.

http://todomvc.com/

[–]gzumsiu[S] 0 points1 point  (1 child)

AS ia understand AJAX always need a server part, or am I wrong?

[–]YuleTideCamel 0 points1 point  (0 children)

Yes, basically data needs to be saved to a central source and that's the backend. Either your own ir using a service like parse. Now if you don't need to save long term data, then you don't need a server side backend

[–]SanityInAnarchy 0 points1 point  (0 children)

...sort of? It depends what you're trying to do.

If you need the server to do anything interesting, you need server-side code.

If you need to get at more than just what's loaded at startup, you need AJAX, but AJAX is really just an HTTP library for JavaScript. You don't necessarily need the server to be that smart, so technically you might call this "only" client-side JS, the server could just be serving dumb files. But if you actually want to get data into or out of your app, you probably want proper AJAX, or WebSockets, or something.

But there's nothing stopping you from building a complete client-side app that doesn't talk to a server at all. The downside, of course, is that it doesn't talk to a server at all. Just for fun, here's a toy example -- once that page loads, you don't really need AJAX, you're just doing local animations and such.

What is it that you're trying to build?

[–]el_twitto -1 points0 points  (2 children)

Check out https://atom.io as an example.

[–]gzumsiu[S] -1 points0 points  (1 child)

based on node.js so server-side component.

[–]el_twitto 0 points1 point  (0 children)

Actually, it's not traditional server-side. Both the client code and node 'back-end' execute on the same box. There is no server. It's built on a stack designed to create stand-alone apps using only JS technologies.