Thursday

jquery.writeCapture.js - Now with 60% more magic!

I've gone ahead and written a jQuery plugin for writeCapture.js. I've reduced the problem to making one extra call in the chain and then the voodoo black magic takes over and you can't go wrong. Here's a kitchen sink example:

$('#foo').writeCapture().find('.bar').html(dangerousHtml).end().
find('.baz').load('returnsDanger.php').after(moreDangerousHtml).end().
addClass('loading');

In this context, "dangerous" HTML is any HTML that does or could contain a script tag that uses document.write, aka, the evil method. The implementation details are wonderfully complicated, but I've made the usage so simple that any code monkey can just chain whatever they like off of a call to writeCapture() and everything will be perfectly "safe". e.g., document.write will not destroy the application and all the content will show up where it is supposed to. So enjoy.

EDIT: the comments here aren't a good place to ask for help. You can get help through GitHub.