PDA

View Full Version : DomHelper, IE and "unknown runtime error"



cwiltgen
31 Jan 2007, 5:09 PM
Hello,

I have an IE-only problem with DomHelper. The following code works great in Firefox and Opera, and I believe other browsers.


YAHOO.ext.DomHelper.overwrite(oElement, {
tag: 'div', style: "width: 480px; height: 216px; position: relative; background: url('/objecty-debug/objecty/movieMiddle.png') 0 100% repeat-x", children: [
{tag: 'img', src: '300-poster.jpg', style: 'position: absolute; top:0; left:0'},
{tag: 'img', src: '/objecty-debug/objecty/movieLeft.png', style: 'position: absolute; bottom:0; left:0'},
{tag: 'img', src: '/objecty-debug/objecty/movieRight.png', style: 'position: absolute; bottom:0; right:0'},
{tag: 'div', style: 'width: 128px; height: 128px; position: absolute; left: 50%; top: 50%', children: [
{tag: 'img', src: '/objecty-debug/objecty/playIcon.png', style: 'width: 128px; height: 128px; position: absolute; left: -50%; top: -50%; opacity: 0.5'}
]
}]
});
oElement is an <object> element.

If you search for IE and "unknown runtime error", a lot of people have this problem. I'm almost hoping that I'm doing something wrong, because nobody seems to know how to solve this problem, or even what causes it.

Thank you,

-- Charles

tryanDLS
31 Jan 2007, 5:43 PM
Did you try stopping in overwrite to capture the html it's trying to put into innerHTML? See if you can just put this html into an object element on an simple html page and open it in IE. It's possible there's a bug with the way IE handles certain content in an object tag. Maybe also related to doctype.

cwiltgen
31 Jan 2007, 8:13 PM
Tim,

I'm reasonably sure that this is an IE bug since I've tried innerHTML, so I'm looking for someone who's run into it and can provide a workaround. Once there's a workaround, then hopefully it could be integrated into DomHelper.

As it is, right now DomHelper will fail in IE in the same way that it's failing for me, probably for many people.

-- Charles

tryanDLS
1 Feb 2007, 7:45 AM
I'm not disagreeing that it's an IE bug. What I'm saying is that if you can't inject the html that supposed to go into innerHTML, by just coding that in an html page, e.g


<object>
my generated html
</object>

there's not a much of a work around - if the plain HTML doesn't work. If it does, that's a different story. Also, does this behavior change dependant on doctype?

Hank Freid
7 May 2008, 10:45 PM
<object>
my generated html
</object>



This is the inner code you can use and solve out your problem. with best wishes and regards

Hank Freid