On Apr 27, 5:06 pm, Anders Jönsson <[email protected]> wrote:
> Hi
>
> The following code works in FF, Chrome, Opera but not in IE8 (IE error:
> "Object doesn't support this action"). Is there any workaround? I want to be
> able to get all the members of a function prototype without using “new
> Obj()”:
>
> var Obj = function(){};
>
> Obj.prototype.someMethod = function() { };
>
> for(item in Obj.prototype){

The identifier 'item' has not been declared. In any case, 'item' is a
global identifier in IE that you can't assign a value to. Use some
other identifier name:

for (var p in ...) {

One reason to avoid global variables is that IE has so many unexpected
ones by default, so consider using an immediately invoked function
expression (iife):

(function() {

  // code here, make sure variables are declared so no unexpected
globals

}());


--
Rob

-- 
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/[email protected]/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/[email protected]/

To unsubscribe from this group, send email to
[email protected]

Reply via email to