IE contentDocument.documentElement problem

Hi,

I am trying to write a cross browser js code

The below line gives "Object doesn't support this property or method" error on an IE browser
while it does not give any error on another IE . Both has exactly the same version.

if (iframeid.contentDocument) var ht0=iframeid.contentDocument.documentElement.scrollHeight;

any idea?
Thank you


tyuretAsked:
Who is Participating?
 
COBOLdinosaurCommented:
Are both IE versions the same, or if they are the same is one running in compatibility mode.  IE does not have cocsistent support for anything across versions you end up having to do one-offs all the time.



Cd&
0
 
hieloCommented:
Try:
iframeid.contentDocument.document.scrollHeight;

OR:
iframeid.contentWindow.document.scrollHeight;

refer to:
http://stackoverflow.com/questions/1477547/getelementbyid-contentdocument-error-in-ie
0
 
tyuretAuthor Commented:
thank you
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.