Deferring Google API
I just love jQuery Deferreds. There are so many things that can be greatly simplified with this concept. Here is how we can write simple wrapper around google api to make it less painful to load and work with. @GoogleAPI = dfd: null, load: -> script = document.createElement("script") script.src = "https://www.google.com/jsapi" script.src+= "?key=API-KEY" script.src+=...
Often times we use jQuery plugins and other scripts to enhance the user experience. These plugins are usually initialized when the page loads and they process html and add some fancy new behavior. But when we start adding content via ajax, things start to get messy. Some of the plugins can be developed to use live event handlers and that they can handle the problem elegantly (with more or less...
Preserving scroll position across pages
When you want to edit specific record, typical rails behavior would be to go to edit page, make your changes, and after saving the record, automatically redirect to model index page. This usually makes user loose its focus on large index pages (where scrolling happens). One way to solve this problem would be to store scroll position for given page in users browser, and then just scroll to that...
It was about time for me to create a blog :) I’ll blog about web related technologies, problems I encounter on daily basis and how i overcome those. I’ll also post links to interesting articles.