Aaron Johnson Now with 50% less caffeine!

Posts Tagged JavaScript

Dates, Milliseconds, Java and Firebug

In Clearspace we store dates using their millisecond representation rather than as a full fledged date in database tables because we don’t want to have to worry about how each database represents dates, but that means that whenever you’re looking at a Clearspace database table, you see values like this:
1172822399000
instead of something like this:
2007-03-01 23:59:59.000
which [...]


Creating a Firefox Sidebar for Clearspace: Part II

It looks like it was almost 2 months ago that I wrote a blog post about the Clearspace plugin for Firefox (called Clearfox), promising that I would follow up with the details on the JavaScript side of the project. I guess time flies when you’re having fun.
Getting started on the JavaScript sidebar [...]


Script.aculous, Autocompleter, Element.collectTextNodes and Element.cleanWhitespace

A couple days ago I was fighting with the Script.aculous autocompleter. I was using code that was almost exactly like the customized autocompletion demo, where the content returned from the AJAX call was a bulleted list of items with each item containing three div’s:

<ul id=”mylist”>
<li>
<div><img src=”/images/avatar/robot.png” /></div>
[...]


Ajax.Autocompleter is not a constructor

Using script.aculous to create some cool effects on your website? Ever get this error message?

Ajax.Autocompleter is not a constructor

All of the results I found on Google suggested that the solution to the problem was to make sure that you were including controls.js (which is where the autocompletion stuff lives in script.aculous). If you checked [...]


DWR Callback rules

If you’ve spent time with DWR, you’ve probably seen both the callback function as last parameter idiom and callback function as first parameter idiom and wondered, wtf? The rules for when each one is applicable are below:

If there is a function first or last then this is the callback function, there is no call [...]


Hacking WebWork Result Types: Freemarker to HTML to JavaScript

I threw all of my past experience with Struts out the window when I started my new job because we use WebWork. WebWork is approximately one thousand times better though so I’m not complaining. One of the unique to WebWork features (as compared to Struts) is the notion of a result type which is [...]


JSON: Making Content Syndication easier

At work we’ve been having some discussions about sharing content between two websites: the natural first option was an XML solution, in this case RSS. Site A would subscribe to the RSS feeds of the site B, periodically retrieving the updated feeds, caching the contents of each feed for a specified period of [...]


FluentInterface

A couple of weeks ago on the DWR users list, in the context of needing to wire up DWR without using an XML file, Joe Walker pointed to a blog posting by Martin Fowler. In it, Martin discusses an interface style called a ‘fluent interface’. It’s a little difficult to describe in words (so check [...]


Transparent PNG plus pngfix.js

A couple weeks back I mentioned that I used this JavaScript hack to enable IE to see transparent PNG’s in the way I wanted them to be seen (you know, with transparency). I should mention that I had to back out that change because pngfix.js mucks with the DOM by wrapping the <img…> tag [...]


Setting up multiple versions of IE plus cookies

The web has got the whole ‘multiple versions of IE’ fairly well documented already, but you have to scroll way down to the bottom of the second article to see that if you want cookies to work, you’ll have to download wininet.dll from Microsoft.
So the full directions:

Download IE 5.0 or IE 5.5
Use a zip utility [...]


← Before