I was toggling a collection of nested HTML elements which was working fine in Firefox, but not in Safari. Even manipulating the display attribute using the console produced the same result. Even stranger, clicking outside of the element after a toggle made the element appear. After an hour or so trying to identify the issue, I left it to return later with a fresh mind. Before returning I had restarted my Mac. Yes, you guessed it. It was working. Have you come across this issue? Please let me know in the comments.
Blog
Wednesday, November 3, 2010
Tuesday, October 19, 2010
Rails UJS using jQuery results in Unknown File Type/Prompted to save file with IE
I'm developing a Rails 2.3 project with the UJS file for Rails 3. Instead of the remote_form_fortags, I'm adding the data-remote attribute. This was running great on Safari and Firefox, but testing a form post on IE would result in the browser trying to save the file. There are a lot of posts regarding this issue, but none of them worked for me.
The fix ended up being very simple. Upgrade jQuery. The application was using 1.4.2. I upgraded to 1.4.3 and everything worked as it should under IE.
Related posts
Wednesday, October 6, 2010
Using rails.js, Rails 3 UJS in Rails 2 application
It took me a while to find these links over the weekend, so I thought I would list them here. I wanted to use the rails.js UJS in a Rails 2 application. I was specifically interested in using jQuery.
- Rails 3.0 unobtrusive Ajax in Rails 2.3.x (the approach I used)
- Rails, JQuery, Unobtrusive JS and Graceful Degradation (an alternative approach)
- rails2_ujs (some helpers from EdgeCase)
I hope you find these helpful. Any other UJS hints for Rails 2? Please add them to the comments.
Friday, August 27, 2010
jQuery Cycle Plugin Ghosting with Transparent PNG's in IE
Some one please stop the Internet Explorer madness. I definitely don't want to become the IE go-to-guy. Back to programming Ruby next week, but today was finally getting the jQuery Cycle Plugin working nicely with transparent PNG's.
The issue: IE's handling of transparent PNG's causing ghosting or dark artifacts when animating with the opacity property. It appears I'm not the onlyperson who has come across this problem. So to get IE to play nicely with jQuery Cycle Plugin I need to apply UnitPNGFix to all versions of IE; this hack is typically used for Internet Explorer version 6.x.
This worked well, but I was getting intermittent errors from Cufón when applying the hack:
Attribute only valid on v:image
As suggested by the guys and gals at Media Dog, placing the UnitPNGFix after the Cufón script would resolve the problem. I had no such luck until I explicitly identified which PNG's to "fix" by specifying the classes with "unitPng". Admittedly this what I should have done in the beginning. Once I specified the elements to fix, IE worked flawlessly with the jQuery Plugin.
As a side note, I've never integrated Cufón into a project before. Does it tend to mess up layout in older browsers? When I say older, I mean Internet Explorer. It certainly generates a lot of HTML, and I'm not totally sure if people are aware of the legality converting fonts and having these openly available on the 'Net. Definitely something I need to further investigate.