Wednesday, March 03, 2010

KB927917

Over the last few months, I have been upgrading some of our websites' login systems. Today I updated the login system of old internal site that some users still use to update stuff. The login system that worked great on our newer web apps, wouldn't load the login screen on the old system. Here is the order of operations:

  • Main Page starts with style sheets, javascript & ajax library, starting body tag, etc.
  • Login Management Custom Tag occurs in middle of page, between begin and end body tags.
  • Login Management Custom Tag launches login cfwindow, navigates window to login form.
  • End of page winds things down, includes closing body tag.
Everything here works great in Firefox (of course), and on our newer Ajax-driven apps it works in IE. However, on this old, not-very-ajaxy website, IE 8 shows the cfwindow appears, and then breaks on the navigate saying: "HTML Parsing Error: Unable to modify the parent container element before the child element is closed (KB927917); Line: 0; Char: 0; Code: 0". Pretty mysterious.

So, lots of searching, and I found this helpful post:

http://blogs.msdn.com/ie/archive/2008/04/23/what-happened-to-operation-aborted.aspx

and additionally this helpful post:

http://social.msdn.microsoft.com/Forums/en/iewebdevelopment/thread/db34068c-5307-4ab7-be03-15b86c2604bb

So, I tried moving my custom tag to the end of the page, outside of the body tag, and that worked great. From what I can tell, the cfwindow, or maybe the ColdFusion.navigate was trying to add elements to the body of the page, before the body had closed.

Whether or not the reason provided above is exactly correct, it makes some sense. After all, our new, ajaxy websites launch the cfwindow from within a container (usually cfdiv), meaning that the main-page's body tag has closed before the cfwindow ever tries to load.

In any case, whether my diagnosis is right or wrong, the medicine worked. This one was a tricky one, so I thought that I would share it with the world.

1 comment:

stivlo said...

I had this problem with IE 8, but the same page didn't have any problem with FF 8.

I solved it by calling my code from jQuery(document).ready(), so the DOM is not modified before is ready.