javascript

A Lesson in the Beauty of Data - XML Parsing on the Front End: to CLJS or not to CLJS?

The task came that I need to parse some XML in a front-only app. In a sense, browsers are just big XML (≅ HTML) processors, so embracing the Clojure principle of being a hosted language, it seemed desirable to utilize the built-in power of my browser. This effort turned out to be a rabbit hole, though. Consider the following: A Native Approach (let [s "<title>Tech.ToryAnderson.com</title>" ;; 1 p (js/DOMParser.) ;; 2 doc (.

Google stuff breaking: setOnLoadCallback

I just had yet another case of stuff I am responsible to maintain breaking because of Google. My long-standing program has run with the following code: google.setOnLoadCallback(function() { /* ... */ }); This has worked for a decade, but finally it seems to have broken. Fortunately, I already had a suspicion that it was a google thing breaking on me as this has happened before. While I am not part of whatever update list is warning about these upcoming changes, they were at least decent enough to tell me that I need to load() charts first.

Easy cross-site slide-show

I recently implemented a small slide-show banner for showcasing products, in this case books, that works across sites. I did it with a nice JQuery slideshow plugin and iframes. I happened to be inserting it into Wordpress pages. The Problem My client has three separate websites he uses for distinct blogs, but as an author he wants to showcase the books he’s published on each of them. It will be a major problem to implement three distinct solutions, even if they are identical, for each blog, and update each one whenever something changes (such as a new book coming out).