I was playing around with the Flickr API recently and got a little stuck: when using jQuery to call the Flickr public feed using jQuery’s $.getJSON method, I wasn’t getting any results. I thought maybe I was parsing the response incorrectly, but when I went to check out the data coming back in firebug, nothing was there. I couldn’t believe it- the response headers were present, but the body was blank. Calling the public feed url from the browser worked fine. What’s more interesting was everything worked in IE. So I did some experimenting and learned the issue: I wasn’t correctly using the endpoint to work with JSONP, which is required when using jQuery with Flickr. Then I thought I better learn more about JSONP.
Tag Archive for 'jquery'
It turns out my most popular article of the past year was Event Pooling with jQuery’s Bind and Trigger. I wanted to write a follow up article taking this approach one step further by discussing how to logically organize the relationship between binders and triggers on a javascript heavy UI. It’s important to properly design the code structure of your javascript to create a flexible and maintainable system. This is essential for any software application. For javascript development, you don’t want to end up with odd dependencies hindering changes or randomly bubbled events causing bugs. Read More
jQuery 1.3 now has a ‘live’ function which acts similar to liveQuery. It lets you wire up events automatically for newly injected DOM elements. Not bad!
There are going to be times when you want to allow a user to enter multiple copies of a single form on a web page. This frequently happens when adding items to a list- like products in a shopping cart or tasks in a task list. You want the user to add as many “items” as they want to the list, then save the entire list at once.
Managing Complexity in the UI
As everyone knows, the more dependencies you have in a system, the harder maintaining that system is. Javascript is no exception- and orchestrating actions across complex user interfaces can be a nightmare if not done properly.