Saturday 15 September 2012

javascript - Why does iterating over the properties of the window object causes an error in IE? -


I have to face this problem many times and in the end it might be thought that it could be worth a question here.

The following code in IE is the result of the output frameElement , which means that the frame element of the property was found but if you found it in the window ["frame"] Trying to access via throws an error.

 for  (window in var i) {try c {w / c window [i]} hold (e) {console.log (i); }}   

I basically realized this problem when I tried to use every property in the window, But always ended with an error.

Does anyone know the reason for this? How can this happen, that there is a property but it is not accessible?

This can be attributes, gates, methods on any object, including any browser window, In which there can be side-effects as well as throwing exceptions.

No comments:

Post a Comment