By jberman on June 25, 2009 at 12:09 pm.
Filed under: Actionscript
I’m building a Flash application for a client which displays a question, waits for the user to absorb it, then disappears, finally showing the various answer choices.
Its been difficult coming to a happy medium when deciding how long it should display the question and make sure the user has enough time to read and absorb its information.
I’ve come to the conclusion that it takes a person one tenth a second for each character to properly read and absorb the sentence before it disappears.
Therefore, you should have taken no longer than 57.5 seconds to read this blog post!
By jberman on June 24, 2009 at 4:43 pm.
Filed under: Browsers, FireFox, HTML, IE, Safari
When editing several files for a French web site that contained non-ASCII latin characters I noticed some strange rendering inconsistencies between Safari and Firefox / IE.
Safari was displaying the characters correctly, however Firefox/IE were not. I tried resaving the file in all different encodings from UTF-8, UTF-16, to Western ISO Latin and got very weird results.
Then I noticed a tag that had been in the existing version of the site:
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
Even though my file was saved as UTF-8, this tag was confusing Firefox and IE into rendering my character data incorrectly. Interestingly, Safari was able to look at the actual file encoding and ignore this meta information.
To fix it all it took was making sure the file was saved as UTF-8 and then making sure the meta tag reflected this:
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
If you encounter strange character rendering then give this a try!
By jthomas on June 15, 2009 at 11:37 am.
Filed under: Frameworks, jQuery
Last week, John showed a technique for enabling a popup anchor to degrade gracefully for users who do not have Javascript enabled. Inspired by his technique, I decided to throw together a jQuery plugin that implements this technique, without having the event attached inline.
It weighs in at just under 1k minified, so it shouldn’t be too tough on your page weight. Feel free to download it and use it for any kind of project.
Usage
Include the plugin as you would any jQuery plugin (where “/path/to/file” is specific to your instance).
Next, put the HTML markup in place (of course the href, target and class can be what you want):
Then, just call popup() on the desired elements:
$(".popup-link").popup();
Additionally, you can provide the desired size of the popup window like so:
$(".popup-link").popup({
width: 320,
height: 240
});
Download it here.
Update
We have posted a new version of the plugin that addresses a small bug. The download link above takes you to the demo/download page which contains the new version. Read more about it on this page.
By jberman on June 12, 2009 at 3:36 pm.
Filed under: HTML, Javascript
Here’s a quick and easy way to open a pop up window that will gracefully degrade to just showing the link in the same window if the user has pop-ups disabled. The “windwidth” and “winheight” params can be changed. This will also center the window on the screen and bring it the the foreground. I’d use this way of opening pop-up windows whenever possible.