Friday, May 02, 2008

Brain Hurts

So uh, what have I been up to lately?

I finally broke down and got a Twitter account. At first I thought I would never touch the thing, but then realize I could update via jabber, which means I'll probably just talk to Twitter all day. My name is xich if any of you want to follow me. I'm a total twitter nub, so don't expect greatness.

Also been working on a sweet bookmarklet idea. It's coming along quite nicely. Found an interesting way around the XSS security in browsers for certain AJAX requests. If you want your bookmarklet to send data back to your server while on another site, normally you'd have to do a real GET/POST (which takes the user away from the site they are on), because XSS security doesn't allow you to make XHR requests across domains. However, if what you want to send to your server is short enough (fits in query string of a GET request), you can simply create a new image and set the source to that querystring. This will make the browser fetch the image (which does a GET request to your server), even across domains. I suppose if you wanted data back you could encode it in the image response and then binary decode it in the client. I haven't tried that, but sounds like it could work, provided javascript has some binary capabilities.

I think I might work on a jQuery plugin to implement this type of request, and if I do, I'll try to describe it better then. I wish I could claim credit for the idea, but I totally stole it from Paul Buchheit's implementation of voting on Hacker News.

Storm last night involved loss of power for a couple hours and water to come through our closed windows. As a result I didn't get a ton of sleep, and complete lack of anything for breakfast means my head is hurting. Thankfully only like six more hours until I can go home and nap.

0 comments: