Tag: <span>jQuery</span>

It’s been over a year since I last touched my bookmark browser, and it needed some attention. There were a couple of outstanding bugs to deal with, plus it seemed like a good time to update the various libraries it uses.

One bug that occasionally cropped up is logging in for the first time and changing to the bookmark page, but having nothing show up. If I did a full refresh of the page then everything would be fine. I never quite figured out what was going on, until now. I assumed there was something I wasn’t doing right with Knockout, so I tried moving the code that does the bindings from the PageBeforeShow event for the bookmark page to right after the AJAX call that gets the data. But that didn’t help. Turns out it was something simple: the bookmark container is initially hidden, and I was never showing it after the first successful login, assuming the app was started in a logged-out state. The solution was showing the container right after the bindings were applied.

And speaking of content not showing right, it suddenly became necessary to add an explicit jQuery Mobile refresh call on the list that holds the bookmark data, like this:

$("#bmMain").listview("refresh");

Without such a call none of the jQuery Mobile styles would be applied unless I did a full page refresh. Not sure why, but whatever. The latest version did resolve a weird style issue with the bookmark menu list showing a double border around each list item, so that’s good.

Recently I was trolling through my collection of lesser-read developer blogs when I came across a September, 2010 blog post from James Senior on jQuery templates, and from there to this one by Stephen Walther. The big news at the time was that Microsoft was going to start contributing code to the jQuery project.

One their first projects was a templating plugin. The idea is you can embed a chunk of markup in a page that contains placeholders for data. Then you call the plugin, pass it some data, and it merges everything into the template, producing markup that is ready for rendering. It looked like just the kind of thing I’d want to start using in production, today. Turns out that would have been a bad idea.

After I downloaded the code and some samples, I surfed around a bit more on the subject and learned that they are no longer actively maintaining the jQuery template plugin. They have decided to go in a new direction. Which is fine, but woe are the people who decided to invest heavily in the plugin during those first few months and are now stuck with a dead-end tool.

The rate of change of web technologies and tools is getting scary fast, and it makes me subconsciously shy away from the latest new stuff because it could all be replaced in 6 months. That might not be the best approach for a professional developer to take, but neither is having such instability in the LOB applications you have to write and maintain.