We ran into an issue with sessions timing out while users were doing client side stuff with an Ember application we’re building. Once the session timed out they could no longer make authenticated requests of course and all ajax calls would fail. Here’s a couple of bits of code that might be helpful. First capture…
Tag: Javascript
Using Chosen with Ember.js
Harvest’s Chosen select control is handy for cleaning up unwieldy or horribly long select boxes. It’s a nice little bit of UI sugar that can help make your users happier and we all like happy users right?. Ember.js is now our Javascript framework of choice but it doesn’t always play well with other libraries and…
Don’t miss the ‘.’ – Computed Property that depends on Ember.ArrayController contents
My fun/stupid ember mistake of the day. I even put together a jsbin to help track down the problem. It’s a tiny problem that is hard to spot. Right there at the very end there’s a property declared like this: property(‘selectedContacts.@each’) </pre> It wasn’t always that way. Once there was this: property(‘selectedContacts@each’) </pre> The difference…
jqXHR Returning Readystate 0 and Status 0?
I’ve seen this error a couple of times and I always forget what causes it so for my own sanity I post it here. If you make an Ajax request and the response comes back with: statusText: “error” status: 0 readyState: 0 then you likely have one of two problems: 1. You are making a…
jQuery ajax request yields statusText: No Transport
If you write code you hate Internet Explorer. You get everything just right in Chrome, Firefox, Safari – any other browser really and then everything falls apart in Internet Explorer. We use CORS in some of the work with do at Open Tapestry. It works really well for letting the client figure out which service…
jurlp and Internet Explorer 8
For those who don’t write code the choice to use Internet Explorer probably hasn’t been influenced by much more than the fact that it’s sitting on the desktop ready to use. For those of us who do write code we hate you. We use jurlp in quite a bit of our code because it’s a…
Require.js, Backbone.js and Almond.js Example Application
We refactored OERGlue to use backbone.js. That makes our life a lot simpler. Along the way we discovered require.js and I entered nerdvana. The documentation for require.js and backbone.js are both good and it doesn’t take to long to read through the code. However, putting them together, getting the development environment right and then deploying…
Backbone.js – Clean up your views
I’ve been integrating backbone.js into OER Glue. After years of writing all kinds of spaghetti javascript code to manage client side ajax backbone.js is like manna from heaven. If you’re new to backbone.js and you want to use it with Ruby on Rails James Yu has a couple of great posts to get you going….
Pushing my luck with jQuery. Scope matters.
OER Glue makes heavy use of jQuery. We’re currently working on a proxy version of the technology that won’t require installing a browser plugin. It’s pretty cool. One of the biggest challenges for us has been ensuring consistent look, feel and operation of our technology across any possible website on the Internet. That’s not a…
Converting a jQuery Object into a String
I’m so used to everything having a ‘to_s’ method that when it’s not there I feel like going out a kicking puppies. In jQuery you can always get the contents of a jQuery object thus: Html: var html = myObject.html(); </pre> Text: var html = myObject.text(); </pre> That’s great and has been extremely helpful over…