Javascript framework for pushstate "hijax" Javascript framework for pushstate "hijax" ajax ajax

Javascript framework for pushstate "hijax"


You may want to checkout History.js and Amplifyjs (and possibly microjs for some components to put together)


I'm going to try to answer your question to the best of my ability. With that being said, I will say that your question is very broad and quite ambiguous. You have not successfully communicated what exactly you're looking for in a JavaScript library. You mentioned a lot of different topics that are all complicated and each exist to server a specific purpose in client-side development. While there maybe be implementations of all of these concepts in the wild, there is no one clear-cut answer to solve all your problems.

I'll start with your first point of "UI / data segregation". This concept is really about separation of concerns. You want your UI to exist separately from your data. What you're really looking for here is for your HTML to reflect the current state of your data model. You also want this to happen automatically for you. This is a very common workflow with an MVC design pattern. JavaScript has several options available to you: Backbone.js, AngularJS, EmberJS, and the list goes on...

In my personal experience of using quite a few of these different frameworks, I would suggest Backbonejs for it's flexible and lightweight nature. In Backbone we have the concept of a "View" that can be tied directly to a data model. It also supports your desired concept of "pushSate" through it's Routes mechanism.

The "Event driven UI" portion can be handled by any number of different JavaScript libraries. jQuery is probably the most popular library to attach events to "all kinds of dom elements". Backbone.js also allows easy setup of event delegation (through event bubbling) with its View object.

In short, if you're looking to add structure to your JavaScript... it really depends exactly what it is you want. For just simple things, a little bit of handcrafted jQuery will do. If you REALLY want a more MVC style app, that has potential to grow, MVC frameworks like Backbone are the way to go.