Search/Replace in the DOM with jQuery
Ever had a need to to a text search/replace through the DOM? For articles in drafting on this blog I often use the form (TODO: somethi...
Ever had a need to to a text search/replace through the DOM? For articles in drafting on this blog I often use the form (TODO: somethi...
>>> function F() { return function inner() { return "inner invoked"; }; }
>...
UPDATE: This technique has turned out to be dangerous in Chrome. It seems that Chrome will load the JS files into the cache, but then set an implied type="text/css" on them. This means that it will refuse to re-use them as Java...
I've been reading Coders At Work by Peter Seibel, and one question he asks in every interview is "How do you debug - print statements, debugger like gdb, or something else?". For me, print statements are my first tool for any situation. That's why Firebug is so...
Update: This advice is now totally out-of-date and wrong. Just use replace
. As recent Browserscope results show, all browsers have optimized replace
to be much faster than split
/join
. Thanks to Luigi van der Pal for pointing this out ...