Skip to content

Issues with third party software

HansCz edited this page Apr 20, 2011 · 6 revisions

PIECSS3 and client_side_validations - How to ward off unexpected objects

Don't use PIE.htc, use PIE.js

A simple fact of the world. Pie is good. Some pies are even useful. like the CSS3 PIE: In a very unobtrusive way it manages to bring much of the icing of css3 to internet explorer. Drop shadows, rounded corners etc. etc.

It can be used to good effect in context with the client_side_validations gem. However…

When you put the two together something breaks. No useful error messages, no nothing. Just an 'Unexpected object' message and a discontented wail from the maladjusted Explorers (6,7 and 8 in IETester). It seems PIE is the possible culprit.

One might speculate it has something to do with execution order. Since it is jQuery that fails, it might have something to do with the fact that rails.validations.js does a bunch of .live binds. Maybe they collide with the dom rewriting that PIE.htc executes? As said, yours truly has no clue, but thought it prudent to make you aware of it.

What to do?

PIE's author recommends using PIE in its behavior form by referencing the file pie.htc in one's stylesheets. Luckily, he also does provides a .js alternative.

Switching from using PIE.htc to PIE.js fixes the issue.

One of the items on the list of advantages to using PIE.js is that it is "...more easily integrated within JavaScript libraries.". I can attest to that, since I went from a broken to a working app. It is still unclear how or why, though. Maybe Jason Johnston, the author of PIE, would care to comment?