The other day I had the need to scramble text on a page so I could capture a screenshot and send it to someone without them seeing the page content. I looked around for a Firefox Add-On that would do it for me but came up blank. So I wrote this quick:
javascript:function%20scramble(el){if(el.nodeType==3){el.nodeValue=el.nodeValue.replace(/[a-zA-Z]/g,function(x){return%20String.fromCharCode(((x.charCodeAt(0)<97)?65:97)+Math.floor(Math.random()*26));});}else{for(var%20i=0;i<el.childNodes.length;++i){scramble(el.childNodes[i]);}}};scramble(document.body);
Give it a try on this page to see how it works. Warning! You’ll have to reload, because you obviously won’t be able to read the text once this runs!
Scramble Text
You can drag this link up to your Links toolbar or into a bookmark to make it easily available on any page.
jQuery underwent some changes in the latest 1.3.1 release, including the elimination of browser sniffing and speed improvements. While I am a regular user of jQuery and I find it useful, I am not an evangelist proclaiming it’s glory. It has problems, and I am often frustrated by approaches taken by the core development team, most recently in a thread on the jQuery Dev group called IE6 feature detection – possible solution.
Then last week, David Mark – a regular contributor to comp.lang.javascript and someone with a lot of javascript knowledge – started a thread called jQuery’s latest stab at competence.
He raises some good technical criticisms of jQuery, and the thread goes on quite long. I voice my opinion as well (we have often clashed in the past on the use of jQuery). For someone who is interested in a deeper understanding of the design of jQuery, some of its technical faults, and a look into whether it’s actually a library that should be recommended, I would recommend reading through these two threads.