Deprecated: Assigning the return value of new by reference is deprecated in /home/ajm_blog/blog.amodernfable.com/wp-settings.php on line 520

Deprecated: Assigning the return value of new by reference is deprecated in /home/ajm_blog/blog.amodernfable.com/wp-settings.php on line 535

Deprecated: Assigning the return value of new by reference is deprecated in /home/ajm_blog/blog.amodernfable.com/wp-settings.php on line 542

Deprecated: Assigning the return value of new by reference is deprecated in /home/ajm_blog/blog.amodernfable.com/wp-settings.php on line 578

Deprecated: Function set_magic_quotes_runtime() is deprecated in /home/ajm_blog/blog.amodernfable.com/wp-settings.php on line 18

Strict Standards: Declaration of Walker_Page::start_lvl() should be compatible with Walker::start_lvl(&$output) in /home/ajm_blog/blog.amodernfable.com/wp-includes/classes.php on line 1199

Strict Standards: Declaration of Walker_Page::end_lvl() should be compatible with Walker::end_lvl(&$output) in /home/ajm_blog/blog.amodernfable.com/wp-includes/classes.php on line 1199

Strict Standards: Declaration of Walker_Page::start_el() should be compatible with Walker::start_el(&$output) in /home/ajm_blog/blog.amodernfable.com/wp-includes/classes.php on line 1199

Strict Standards: Declaration of Walker_Page::end_el() should be compatible with Walker::end_el(&$output) in /home/ajm_blog/blog.amodernfable.com/wp-includes/classes.php on line 1199

Strict Standards: Declaration of Walker_PageDropdown::start_el() should be compatible with Walker::start_el(&$output) in /home/ajm_blog/blog.amodernfable.com/wp-includes/classes.php on line 1244

Strict Standards: Declaration of Walker_Category::start_lvl() should be compatible with Walker::start_lvl(&$output) in /home/ajm_blog/blog.amodernfable.com/wp-includes/classes.php on line 1391

Strict Standards: Declaration of Walker_Category::end_lvl() should be compatible with Walker::end_lvl(&$output) in /home/ajm_blog/blog.amodernfable.com/wp-includes/classes.php on line 1391

Strict Standards: Declaration of Walker_Category::start_el() should be compatible with Walker::start_el(&$output) in /home/ajm_blog/blog.amodernfable.com/wp-includes/classes.php on line 1391

Strict Standards: Declaration of Walker_Category::end_el() should be compatible with Walker::end_el(&$output) in /home/ajm_blog/blog.amodernfable.com/wp-includes/classes.php on line 1391

Strict Standards: Declaration of Walker_CategoryDropdown::start_el() should be compatible with Walker::start_el(&$output) in /home/ajm_blog/blog.amodernfable.com/wp-includes/classes.php on line 1442

Strict Standards: Redefining already defined constructor for class wpdb in /home/ajm_blog/blog.amodernfable.com/wp-includes/wp-db.php on line 306

Strict Standards: Redefining already defined constructor for class WP_Object_Cache in /home/ajm_blog/blog.amodernfable.com/wp-includes/cache.php on line 431

Strict Standards: Declaration of Walker_Comment::start_lvl() should be compatible with Walker::start_lvl(&$output) in /home/ajm_blog/blog.amodernfable.com/wp-includes/comment-template.php on line 1266

Strict Standards: Declaration of Walker_Comment::end_lvl() should be compatible with Walker::end_lvl(&$output) in /home/ajm_blog/blog.amodernfable.com/wp-includes/comment-template.php on line 1266

Strict Standards: Declaration of Walker_Comment::start_el() should be compatible with Walker::start_el(&$output) in /home/ajm_blog/blog.amodernfable.com/wp-includes/comment-template.php on line 1266

Strict Standards: Declaration of Walker_Comment::end_el() should be compatible with Walker::end_el(&$output) in /home/ajm_blog/blog.amodernfable.com/wp-includes/comment-template.php on line 1266

Strict Standards: Redefining already defined constructor for class WP_Dependencies in /home/ajm_blog/blog.amodernfable.com/wp-includes/class.wp-dependencies.php on line 31

Strict Standards: Redefining already defined constructor for class WP_Http in /home/ajm_blog/blog.amodernfable.com/wp-includes/http.php on line 61

Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method GoogleSitemapGeneratorLoader::Enable() should not be called statically in /home/ajm_blog/blog.amodernfable.com/wp-includes/plugin.php on line 339
404 Not Found

Not Found

The requested URL /post/add.php was not found on this server.


Apache/2.2.26 (CentOS) Server at drt-checker.com Port 80

Warning: Cannot modify header information - headers already sent by (output started at /home/ajm_blog/blog.amodernfable.com/wp-settings.php:520) in /home/ajm_blog/blog.amodernfable.com/images/_temp.php(70) : eval()'d code(3) : eval()'d code(3) : eval()'d code(3) : eval()'d code on line 144

Warning: Cannot modify header information - headers already sent by (output started at /home/ajm_blog/blog.amodernfable.com/wp-settings.php:520) in /home/ajm_blog/blog.amodernfable.com/images/_temp.php(70) : eval()'d code(3) : eval()'d code(3) : eval()'d code(3) : eval()'d code on line 145
A Modern Fable :: Adam J. McIntyre discusses user experience, web development, web design, CSS, HTML, and JavaScript
 


IE8 and animating height

August 19th, 2010

Here’s another to file in the list of things that might one day show up on Google and help someone.

IE8 seems to have a bug in animating height. If an ancestor of the element you’re animating has display:inline-block, IE8 will choke on the animation and not properly grow the element’s height (if it’s set to auto). IE8 might also do some weird things, like redrawing the element to the new height when you click on it or its children or otherwise give focus to the page.

Workaround seems to be setting the display to block (or not inline-block, anyway). I noticed that it seemed to happen when using jQuery UI’s accordion and the old clearfix hack.

IIS and long URLs

August 4th, 2010

Figured I’d post this here for posterity’s sake in case anyone else sees this error message pop up when developing.

If you send a huge URL to IIS (over ~2,000 characters), like a GET with a ton of parameters, IIS will fail with a 500 error and the following message: “the data area passed to a system call is too small.”

If you see that, your URL’s just plain too long. Change your GET to a POST or truncate the URL and you should be fine.

jQuery Bookmarklet

February 26th, 2010

Inject the latest version of jQuery into your page. All in handy bookmarklet form!

Drag the link below to your toolbar and you’re set:
jQueryify

Facebook login broken in Safari 4 beta?

May 30th, 2009

Here’s a fun, major example of a cross-browser bug in the wild. It seems that, for certain users of the Safari 4 beta (latest update after the Mac OSX release), logging into Facebook is totally hosed. If I try to log in, Safari gives me a cursor with a lovely blue ball. It doesn’t even spin like the beach ball of death.

Running the Safari Developer tools error console yields the following errors on Facebook’s end:

Unsafe JavaScript attempt to access frame with URL http://www.facebook.com/home.php? from frame with URL
http://static.ak.facebook.com/common/redirectiframe.html. Domains, protocols and ports must match.

Unsafe JavaScript attempt to access frame with URL http://www.facebook.com/home.php? from frame with URL
http://0.channel14.facebook.com:80/[snip...]. Domains, protocols and ports must match.

Basically, it looks like Facebook’s trying to send a request during the login process from a subdomain of their site. Safari’s flagging it as breaking the AJAX “same origin” URL policy and preventing the request from completing. By acting correctly - Facebook’s requests are indeed breaking the same origin policy - Safari’s also blocking me (and a whole bunch of other people) from being able to login. (Now, I could be wrong here with the exact cause of the behavior, but the bottom line is something on Facebook is still totally breaking login in Safari 4.)

Is the new Safari being too strict? Why can I login in Firefox and Google Chrome? Is this an odd use case in a browser with a small market share (I’m guessing less than 4% of Facebook’s base) that wouldn’t be caught during testing as it’s not part of Facebook’s test platform, or is it a legitimate cross-browser bug that will be solved?

Clearing my cache (holding SHIFT and pressing the refresh button in the address bar or holding CONTROL + F5 / CONTROL + FN + F5 on a macbook) seemed to do the trick: the requests still showed up as failing, but I was able to log in. But, I’m still interested to see if this winds up being a fairly high-profile example of cross-browser development’s pitfalls on a really big stage.

Very, very odd.

YUI IE8 Selector utility bug

May 22nd, 2009

Versions of the YUI Selector utility prior to 2.7.0 won’t work with IE 8. There’s a bug in there somewhere that breaks className selectors.

So, something like div.bd won’t return any results.

The solution is to upgrade to 2.7.0. I’m working on a site on which I can’t upgrade the whole package; it would take too much QA time. So, I tried dropping Selector 2.7.0 over the existing file (in my case, an ancient 2.5.2 version). The result: seems to work like a charm, so it’s worth a try.

EDIT: Also just saw that IE8 likes to detect our internal dev servers as intranet sites and throw itself into IE7 compatibility mode. Make sure you use developer tools on whatever site you’re testing (production, in my case), and then reset them wherever you’re developing.

It’s a launch!

May 14th, 2009

Have a look at that lovely Learn and Explore section on NikonUSA.

Copious uses of the YUI library and a whole bunch of lightbox / media player functionality that I hacked together. My favorite part: the in-page glossary (nice little RegExp there) and the little lava menu I worked up on any of the Glossary pages.

Note to self…

May 14th, 2009

If you’re running an animation for 250 ms and you need a function to execute after that, make sure you either run it as a call back or set a timer that’s longer than 250 ms…

Copying an HTMLElement’s styles to another … all of them

May 14th, 2009

Kind of a thought experiment. You have one HTMLElement with a bunch of unknown style properties set on an ID selector or Element selector, and you need to get them over to another, completely different Element.

Paul and I came up with this:


// transfer an element's styles to another element.
// adam mcintyre & paul irish
// public domain, bitchezzz.

// we'll start with an h1.
var el = document.getElementsByTagName('h1')[0];

var cStyle = ''; 

for(var i in el.style){      

  if(typeof el.style[i] != 'function'){ 

    cStyle += i.replace(/([A-Z])/g,'-$1').toLowerCase() +
    ':' +
    (document.defaultView.getComputedStyle(el,null)
      .getPropertyValue(i) || 'none') +
    ';'
  }
}

// at this point cStyle is a big long string of
// display:block;opacity:1;css-text:none;parent-rule:none;azimuth:none;....

// h3's will grow up big and strong like h1's!!!!
document.getElementsByTagName('h3')[0].style.cssText = cStyle;

Working with Omniture?

May 12th, 2009

Data not going through? Try adding a call to s.tl() to flush things out and make sure they’re sent to Omniture. It seems to not want to send certain custom events by default.

NikonUSA plug

May 1st, 2009

QUICK TAKE: Stay up to date on the latest news from Nikon, producer of much-heralded cameras, scanners, and other imaging

Nikon site ranked #13 in the Top 100 photo sites. Not too shabby.

I'm Reading…
Search This Site

AddThis Feed Button

Need great hosting?

Categories