Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Captain Pike
Jul 29, 2003

Hello Friends!

I think I might need one of these fancy bespoke frameworks for my summer-scarf!

I am writing a web page 'app' that does the following:

- Uses GET/POST ajax calls to a crossdomain server.
- The user can alter the json objects retrieved from the server.
- The user's altered json values are then 'saved' to the server, via ajax POST calls.
- The new state of the server's json object is retrieved via ajax GET.
- The web page UI is redrawn to reflect the server json object state.

I have this all working, but I am doing this all manually. For example, when I get a json object array from the server, via ajax/GET callback, I iterate through the json array using a for-loop. I then use something that looks really gross like:

code:
document.getElementById('myFormContainerDiv').innerHTML += "<div id='" + jsonArray[i].someId +"....
I feel like a bad old caveman! :(

I discovered Backbone and Agility yesterday, which seemed like exactly what I needed! If I could 'bind' json objects to HTML templates, and easily sync the html UI with the server's state, that would be awesome!

However, it appears that it is impossible to use Backbone, because the HTML5 'History' object will not use crossdomain URLs.

Is there something else I can use? I am fine using my manually-written ajax POST/GET calls if I have to, but I would at least like to 'bind' json objects to html templates. If I could use something to 'sync' with the server state, that would be great too! :3

Questions:

- Is there an Ember/Backbone-y thing that works across domains?
- If not, is there a good html template-y thing that simply 'binds' json objects to html forms/elements?


Edit: Knockout.js appears to do exactly what I want! Yay!

Captain Pike fucked around with this message at 20:41 on Aug 20, 2014

Adbot
ADBOT LOVES YOU

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply