do while help please.....

A

Asen Bozhilov

Dmitry said:
3. It's portable.

-- Yeah, but I'm not sure that you will define all the (needed)
structure of the `window' including `window' inself. Moreover, I can't
imagine, what will you code do in *completely different* environment.
In *completely different* environment you'll use completely different
host objects. That's absolutely doesn't mean: "the code which works
identically in all host environments, the only thing to do - is
manually define needed objects in host environment". You code also
won't have sense in completely different host environment if there
will be `window' object and even will be `window.alert', but with
*completely different* meaning and behavior. So, this is also doubtful
argument.

From your 4 points i think this is only reasonable point. Here
implementation of concrete `window' object doesn't matter. I said it.
When i use window.alert that share me, easy to migrate in different
environment, without create properties of Global Object. For my, that
is better design and easy to port in different environment. ;~)

Regards and happy holidays.
 
D

Dmitry A. Soshnikov

From your 4 points i think this is only reasonable point. Here
implementation of concrete `window' object doesn't matter. I said it.
When i use window.alert that share me, easy to migrate in different
environment, without create properties of Global Object. For my, that
is better design and easy to port in different environment. ;~)

Regards and happy holidays.

Btw, Asen, just one more question I have, do I understand correctly
that you use this prefix every time in browser scripting? I mean for
e.g. `window.document.getElementById', or `window.ActiveXObject' in IE
(but actually I don't know, does IE put `ActiveXObject' name into the
`window' or into the global)? Can you show me the real code, I'm just
interested.

/ds
 
A

Asen Bozhilov

Dmitry said:
Btw, Asen, just one more question I have, do I understand correctly
that you use this prefix every time in browser scripting? I mean for
e.g. `window.document.getElementById', or `window.ActiveXObject' in IE
(but actually I don't know, does IE put `ActiveXObject' name into the
`window' or into the global)? Can you show me the real code, I'm just
interested.

Exactly. Regarding `ActiveXObject'. In JScript `ActiveXObject' is
property of Global Object. You can see that in easy way. From
{DontDelete} bug in `eval' variable declaration:

eval('var ActiveXObject = null');
window.alert(ActiveXObject); //null
window.alert(delete ActiveXObject); //true
window.alert(ActiveXObject); //Reference Error
 
D

Dmitry A. Soshnikov


Thanks, no more questions by this part.

Regarding `ActiveXObject'. In JScript `ActiveXObject' is
property of Global Object. You can see that in easy way. From
{DontDelete} bug in `eval' variable declaration:

eval('var ActiveXObject = null');
window.alert(ActiveXObject); //null
window.alert(delete ActiveXObject); //true
window.alert(ActiveXObject); //Reference Error

ActiveXObject has {DontDelete} == false by default, you can simply
do:

alert(ActiveXObject);
delete ActiveXObject;
alert(ActiveXObject);

But does delete operation without throwing an exception means in IE,
that property is the own property of global? I don't know. For
example:

var a = 10;
delete a; // false (as DontDelete = false), but no exception

this.b = 10;
delete b; // exception in IE

So, I don't know is ActiveXObject a property of the global or not.

/ds
 
A

Asen Bozhilov

Dmitry said:
So, I don't know is ActiveXObject a property of the global or not.

If you are right, that will be mean Microsoft used different
implementation of JScript in browser environment and in WSH. See
below:

WScript.Echo(typeof window); //undefined
WScript.Echo(typeof this.ActiveXObject); //function
 
D

Dmitry A. Soshnikov

If you are right, that will be mean Microsoft used different
implementation of JScript in browser environment and in WSH. See
below:

WScript.Echo(typeof window); //undefined
WScript.Echo(typeof this.ActiveXObject); //function

I don't know, but don't think that they use different implementations
(and from the this guess ActiveXObject can be treated as property of
the global). Unfortunately, built-in debugger of IE8 doesn't show this
property (ActiveXObject) neither in `window' nor in `this' for global
context.

/ds
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,082
Messages
2,570,588
Members
47,209
Latest member
Ingeborg61

Latest Threads

Top