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.
Posted in development by ajm | No Comments »
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.
Posted in development by ajm | No Comments »
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
Posted in development by ajm | 1 Comment »
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.
Posted in cross browser by ajm | 1 Comment »
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.
Posted in code by ajm | 1 Comment »
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.
Posted in code by ajm | No Comments »
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…
Posted in code by ajm | No Comments »
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;
Posted in css by ajm | No Comments »
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.
Posted in code by ajm | 3 Comments »
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.
Posted in development, projects by ajm | No Comments »