Sunday, May 19, 2024
124
rated 0 times [  127] [ 3]  / answers: 1 / hits: 21514  / 15 Years ago, thu, july 2, 2009, 12:00:00

I can't find any information on this issue; why doesn't the following code work in IE?



window.x = 45;
delete window.x;
// or delete window['x'];


IE reports an object doesn't support this action error. Does it have anything to do with that iterating over window properties in IE issue?


More From » internet-explorer

 Answers
114

I would do it this way:



    window[x] = undefined;
try{
delete window[x];
}catch(e){}

[#99202] Saturday, June 27, 2009, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
kevonmoisesf

Total Points: 693
Total Questions: 101
Total Answers: 128

Location: Reunion
Member since Mon, Dec 28, 2020
3 Years ago
kevonmoisesf questions
Sat, Jan 23, 21, 00:00, 3 Years ago
Tue, Feb 18, 20, 00:00, 4 Years ago
Wed, Jun 12, 19, 00:00, 5 Years ago
;