Thursday, April 17, 2008

Responds_to_parent loc error

If the rjs inside your responds_to_parent block ended up removing the iframe from your html page, the loc variable will no longer be defined.

Besides having an ugly error message on your firebug console, it can actually cause problems for the javascripts on that page as well.

In order the get around this problem, you'll need to do the following patches:

in parent_selector_assertion.rb and responds_to_parent.rb

replace all occurrence of
(3 in parent_selector_assertion, 1 in responds_to_parent)
loc.replace('about:blank');

with
if (window.loc) { loc.replace('about:blank'); }
and that's it!


J

No comments: