Communicate with certainty
and your Voice will be heard.

Monthly Archives: March 2007


Please note that this hack does not work in Safari 3. The updated hack is here.

While I’m not a fan of CSS hacks in general, there comes a time when nothing else will solve the problem. This was the situation this morning—the site looked perfect in every browser except Safari (due to a background repeat bug), and I needed a quick way to apply CSS rules to Safari alone. Here’s the hack:

Place the pound sign ( # ) after a semi-colon ( ; ), all styles within those brackets and the remainder of the stylesheet will be ignored in Safari.

Example: The following code will make any <p> assigned the callout class red with normal font-weight in Safari, but black and bold in the rest of the browsers.

1
p.callout { color:#FF0000; font-weight:normal; }<br />p.callout { color:#000000; font-weight:bold;# }

[demo]

Tested on Mac OS X version 10.4.9 with Safari version 2.0.4 (419.3) and Mozilla Firefox version 2.0.0.3. Tested on Windows XP SP 2 with Mozilla Firefox version 2.0.0.3, Opera 9.10, and Microsoft Internet Explorer 6 and 7. Hack from bballcity

These are the notes to my recent presentation on AJAX and forms to the New York Web Standards Meetup Group. These notes were purposefully left open and vague to facilitate discussion based on attendees’ interests—during the presentation a lot of good questions were asked. That dialogue is not represented here.

Hello, my name is Jeffrey Barke. I’m the Senior Developer and Information Architect for the US office of theMechanism and I plan on talking briefly about how to easily use AJAX to improve the usability of forms and admin/control panel interfaces.

More

Updated mini AJAX yesterday after I discovered a function name conflict in Internet Explorer 7. This conflict only occurs if one is using mini AJAX in tandem with Prototype [which we do all the time]. For some unknown reason, this hadn’t been a problem for any of the other browsers [Safari, Firefox on Mac and Firefox, Opera on PC], but it caused the script to fail ignominiously in Internet Explorer 7.

So, if you downloaded mini AJAX from this site prior to 16 March 2007 and plan on using it with Prototype or script.aculo.us, please download the latest version here.

Karakuri (Mechanism)

March 14th, 2007  |   fun, random

Wadokei (Japanese clock)While reading Naruto the other day, I noticed that the author, Masashi Kishimoto, had previously done a series titled Karakuri, which was translated as “Mechanism.” I had no idea what type of mechanism Karakuri were/are, but since I love anime, automatons, and answers, I had to know more. Here’s what I found:

Karakuri ningyo are mechanized puppets or automata from Japan from the 18th century to 19th century. The word “Karakuri” means a “mechanical device to tease, trick, or take a person by surprise.” It implies hidden magic, or an element of mystery. In Japanese, ningyo is written as two separate characters, meaning person and shape. It may be translated as puppet, but also by doll or effigy. (Wikipedia)

Japan’s love of robots lies in the history of the Karakuri Ningyo. Until now there has been little interest from outside Japan regarding the Karakuri Ningyo craft, and its influence on technology and the arts. (Karakuri.info)

The Japanese Karakuri puppets utilise subtle, abstract movements to invoke feeing and emotion. There are three main categories of Karakuri. “Butai Karakuri” are puppets used in the theatre, “Zashiki Karakuri” are small and can be played with in rooms and “Dashi Karakuri” puppets perform on wooden floats used in religious festivals. Traditionally Karakuri appeared in religious festivals, performed re enactments of traditional myths and legends and entertained the public with their sophisticated, symbolic and graceful gestures. (Karakuri.info)

More information:

Dave, Josh, Jeff and Tony drone on endlessly about Jeffrey’s first month, Anna Nicole Smith, the UK Space Program, NASA, adult diapers and the Grammys. theMechanism also tells The Police where to find us for their necessary new web design in our first podcast of 2007.

Go and get our 6th mighty Episode

mini AJAX

March 06th, 2007  |   programming

Mini AJAX is a “handy, lightweight” set of AJAX functions recently adopted by theMechanism. While Tim Morgan’s script is well-documented and easy to plug into an existing application, we did find it a bit limiting that it only returns string data (

1
responseText

). Since we’re typically accessing XML, it would be nice to have the option of using

1
responseXML

.

So, we modified mini AJAX by adding two new methods that do just that:

ajax.getxml(strUrl, strFunc)
strUrl—the URL to query (can contain arguments after a “?”)
strFunc—the function to call once the response is returned
This method uses a GET request to query the specified URL and return a response as an XML DOM object to the specified function.

ajax.postxml(strUrl, strFunc, strArgs)
strUrl—the URL to query
strFunc—the function to call once the response is returned
strArgs—a string containing arguments to be passed to the URL
This method uses a POST request to query the specified URL and return a response as an XML DOM object to the specified function.

20070315 update—Updated mini AJAX after I discovered a function name conflict in Internet Explorer 7. This conflict only occurs if one is using mini AJAX in tandem with Prototype [which we do all the time]. For some unknown reason, this hadn’t been a problem for any of the other browsers [Safari, Firefox on Mac and Firefox, Opera on PC], but it caused the script to fail ignominiously in Internet Explorer.

The updated version of mini AJAX can be found here.