
I’m running some tests tonight on my JavaScript tabber code… yeah, I would say it handles nested tabs.

I’m running some tests tonight on my JavaScript tabber code… yeah, I would say it handles nested tabs.
If you have a bunch of funky data to store in a JavaScript string, for example some HTML, you have to be careful to “escape” all the special characters so it doesn’t break your script.
Or you can just use my web data encoder and choose “JavaScript-safe” variable:
You can also use other encodings, such as encodeURIComponent to make a complex URL safe to pass as a component of another URL.
The Holy Grail in creating dynamic HTML is to have a page that works perfectly even when JavaScript is disabled. You want your page to be beautiful and dynamic, but you also want it to be accessible, search-engine optimized, and printable.
To make this happen you start with plain, semantic HTML, then you add a JavaScript layer to rework the page into something better:

One problem with this technique is that your JavaScript must run after the HTML has been set up and rendered on the page, so a user with a slow connection might see something like this using my JavaScript tabbifier:

This is not too pretty, so obviously we want to make it stop.
Your first thought might be “I’ll just add a style to the content to make it hidden (CSS display:none), then my JavaScript will run and reveal it!” But that puts a big crack in our Holy Grail, because if you use CSS to hide the content, it will not be visible to users who do not have JavaScript.
Here’s the method I used:
Here are two examples, one that exhibits the flashing problem, and another that fixes it using the technique described above. Note that in order to see the flashing problem, you need a slow internet connection: I recommend throttling your connection using the excellent Charles Web Debugging Proxy.
Welcome, Ajaxians!
Bobby describes an alternate technique in case you are serving XHTML pages that use MIME type application/xhtml+xml.
Steve Clay makes a valid point that we should check for DOM compatibility before writing the styles on the page.
He cupped her university of phoenix online universities
Sunday, March 12th, 2006Within a few hours of re-activating the discussion boards here on BarelyFitz, I started getting spammers.
Spammers have determined that if they register for a message board account, they can leave a link to their webpage, and the link shows up on the message board user list. I’ll have to hack PHPBB to remove this back door for spammers.
I noticed the following interesting attempt: instead of leaving an obvious link to a spammer site, the link was something like the following:
This URL looks relatively innocent – after all it has the word “religious” in it! But if you follow the link, you get a page that uses JavaScript to immediately redirect you to the spammer’s site.
After a bit more digging into the redirect page I found a JavaScript program that does the redirecting (heavily obfuscated to prevent Google from discovering the true purpose of the script), plus a bunch of computer-generated text to geared to increase their search results, a sample of which follows:
Update 2006-03-14: This morning there were three message board spam posts, which I quickly eliminated when I saw them in my RSS feed. They wouldn’t have helped the spammer since the links were all marked as rel=”nofollow” after some changes I made to PHPBB. But I just don’t want to deal with it, so I changed the discussion boards to require registration before posting. Sigh… why do spammers have to ruin it for all of us.
It would be nice if PHPBB had the same “moderate once” system that WordPress uses.
Posted in HTML, JavaScript, Message Boards, PHPBB, Spam, Web, WordPress, blogging, comment spam | 2 Comments »