Cogteeth.com - personalized T-Shirts
Oct 6, 2006
Partly as an experiment with the new Zazzle API, I've created a new site Cogteeth.com.
At Cogteeth you can create customized T-Shirts by entering messages for the back and front of the shirt. The text of the messages is converted to UTF-8 and the resulting codes displayed in hex. The result is a T-Shirt with a coded mesage that only those with too much time on their hands can read.
Here's what I've learnt from this exercise:
- Passing an empty field to http://www.zazzle.com/api/create is the same as not including it in the request (i.e. the text in the template will be used). So If you want to leave a text field blank, you must pass in a SPACE (e.g. http://www.zazzle.com/api/create?frontText=%20&blah=...).
- The Zazzle API does not yet support non-ASCII characters. Passing a UTF-8 encoded character sequence (e.g. http://www.zazzle.com/api/create?frontText=%C2%B7) will NOT result in the UTF-8 C2:B7 character. Zazzle say this may be supported in future.
- Although the HTML 4 spec suggests that only ASCII values can be used in HTTP GET form submissions, most browsers will sensibly encode non-ASCII characters in UTF-8 and then URL encode them before submission. (This assumes the page containing the form was sent as UTF-8 encoded).
- Why isn't there an "onFieldValueChange" event for form fields? I currently use the "keyup" event but I'm not interested whether the change was due to a keystroke, I just want to know if a change occured. The onChange event is no use here - it only fires when the field loses focus.