Re: JavaScript vs VB Script in Microsoft Scripting engines

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

rossenbg_at_hotmail.com
Date: 11/01/04


Date: Mon, 01 Nov 2004 07:40:15 +0200


Doh,

I have found the problem. The real name I have gave to my "someobject" was
actually "arguments" which is a object in the Standart JavaScript
language. And thus running code outside function used my object, but
running it inside function uses JavaScript one.

Does anyone knows why is this? I know that I have made BIG mistake, but I
would like to know why different objects are accessed depending where in
the JavaScript code they are used?

Cheers

On Mon, 01 Nov 2004 06:43:51 +0200, <rossenbg@hotmail.com> wrote:

>
> Hi all,
>
> I have had recently strange behaviour using JavaScript and VBScript
> engines, provided with Micorsoft Windows. It appears that when JS
> scripting engine is used, working with objects, inside JS functions,
> does not work. For example parsing code like:
>
> function some()
> {
> var cnt = someobject.count;
> ...
> }
> some();
>
> will give me an error, because inside the function the result returned
> by "someobject.count" is invalid ( VT_EMPTY ). I've debug the
> application and "propget" for "count" is never called. But if I parse
> only this:
>
> var cnt = someobject.count;
>
> then everything is just fine. In VisualBasic all the cases are OK. Do
> any of you had such behaviour using MS JavaScript and how this was
> solved?
>
> Cheers
>

-- 
Rossen Tzonev
Sofia, Bulgaria


Relevant Pages

  • JavaScript vs VB Script in Microsoft Scripting engines
    ... I have had recently strange behaviour using JavaScript and VBScript ... engines, provided with Micorsoft Windows. ... scripting engine is used, working with objects, inside JS functions, does ...
    (microsoft.public.vc.atl)
  • Re: Access violation for TWebBrowser: fixes didnt work at all
    ... this if Javascript in the page tries to move the current browser window, ... very strange behaviour: sometimes, the control extend itself on the ...
    (comp.lang.pascal.delphi.misc)
  • Re: Explorer crashes without any errors/diagnostics
    ... It may also be a JavaScript problem, there seems to be a lot of them related ... You can try updating your scripting engine. ... Replies are posted only to the newsgroup for the benefit or other readers. ... How to make a good newsgroup post: ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: failure of browser on certain sites
    ... It may also be a JavaScript problem, try the following and see if it helps: ... You can try updating your scripting engine. ... Replies are posted only to the newsgroup for the benefit or other readers. ... How to make a good newsgroup post: ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: error 501
    ... It may also be a JavaScript problem, try the following and see if it helps: ... You can try updating your scripting engine. ... Replies are posted only to the newsgroup for the benefit or other readers. ... How to make a good newsgroup post: ...
    (microsoft.public.windows.inetexplorer.ie6.browser)