On Jan 14, 2:20*pm, Thomas 'PointedEars' Lahn <PointedE...@web.de>
wrote:
> Mark Smith wrote:
> > I am getting a strange error in internet explorer, the following code
> > is working in firefox.
>
> > Line 33 displays the id of div, so the div object is ok.
>
> > ...
> > 33: alert(div.id);
> > 34: container=document.getElementById(div.id+"_contain er");
> > ...
>
> > And the following error occurs on line 34:
>
> > [...]
> > Line: 34
> > Error: Object doesn't support this property or method
> > [...]
>
> > document.getElementById is supported in IE 7, right?
>
> Correct.
>
> > And even if an object with ID, div.id+"_container" did not exist
> > (which it does), the worst case should be that it returns null... So
> > what could possibly be causing this?
>
> Chances are that you have an element with name or ID "container" in the
> document, and you did not declare the `container' identifier in the script
> with
>
> * var container ...
>
> MSHTML proprietarily makes properties of a host object in the scope chain
> out of element names or IDs in the document so that you can refer to the
> corresponding element objects by script identifier. *However, those
> host-defined properties cannot be written to without throwing an exception.
>
> We have discussed this (ad nauseam) before.
>
> PointedEars
That was it exactly, thanks!
I was pulling my hair out over this, because it worked in IE on simple
pages. But broke when I put it in the symfony framework.
|