Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > microsoft.public.scripting.vbscript > #11990
| Newsgroups | microsoft.public.scripting.vbscript |
|---|---|
| Subject | Re: Mysterious "Unknown runtime error" in a script in a HTA file |
| From | "Evertjan." <exxjxw.hannivoort@inter.nl.net> |
| References | <196wno10v1fr3$.35ss8tnh6gzc.dlg@40tude.net> <XnsA97CA507866Eeejj99@194.109.6.166> <pq2885$h35$1@dont-email.me> <XnsA97CEDD4CF47Eeejj99@194.109.6.166> <pq36fj$lo3$1@dont-email.me> |
| Date | 2018-10-16 10:01 +0200 |
| Message-ID | <XnsA97D65FE7255Beejj99@194.109.6.166> (permalink) |
"Mayayana" <mayayana@invalid.nospam> wrote on 16 Oct 2018 in
microsoft.public.scripting.vbscript:
> "Evertjan." <exxjxw.hannivoort@inter.nl.net> wrote
>
>| > I've never understood why anyone uses getElementById.
>| > It's a superfluous, overcomplicated version of just
>| > referencing the ID itself. There's nothing wrong with
>| > his tbl.innerHTML.
>|
>| No, it is not,
>| it is just an remnant in IE, I think, as
>| just the id-name could also mean a variable that is defined in js.
>|
>
> Who would use a variable with the same name
> as an element ID? If you can't keep them straight
> then you might try using naming patterns. In other
> words, name a DIV "DivMain" or a TABLE "TabMain".
> Don't name a TABLE "i" or "s" and don't name a
> variable "TableMain" or "ContentDiv". Problem solved. :)
>
>| In modern browsers there is:
>|
>| document.getElementById("tbl")
>| document.querySelector("#tbl")
>| document.querySelectorAll("#tbl")[0]
>|
>
> There's nothing modern about it. getElementById
> works back at least to IE6. Probably IE4. But it's
> not necessary. The following works perfectly fine
> in "modern" Firefox:
>
> <HTML>
> <HEAD>
> </HEAD>
> <BODY>
> <DIV ID="div1">
> </DIV>
> <SCRIPT>
> div1.innerText="okey doke";
> </SCRIPT>
> </BODY></HTML>
>
> If you don't trust yourself to keep your variables
> separate from your IDs and classes then you can
> use those methods, but they are superfluous.
If you trust yourself,
there is no need for any scripting-convention.
You could easily do:
const myChangingValue;
let myConstantValue;
However, in interaction with others, there is.
So if you ask about/discuss your code in this NG,
please don't advocate for your selftrusted shortcuts.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Back to microsoft.public.scripting.vbscript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Mysterious "Unknown runtime error" in a script in a HTA file JJ <jj4public@vfemail.net> - 2018-10-15 20:31 +0700
Re: Mysterious "Unknown runtime error" in a script in a HTA file "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2018-10-15 16:13 +0200
Re: Mysterious "Unknown runtime error" in a script in a HTA file "Mayayana" <mayayana@invalid.nospam> - 2018-10-15 10:28 -0400
Re: Mysterious "Unknown runtime error" in a script in a HTA file "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2018-10-15 23:22 +0200
Re: Mysterious "Unknown runtime error" in a script in a HTA file "Mayayana" <mayayana@invalid.nospam> - 2018-10-15 19:04 -0400
Re: Mysterious "Unknown runtime error" in a script in a HTA file "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2018-10-16 10:01 +0200
Re: Mysterious "Unknown runtime error" in a script in a HTA file "R.Wieser" <address@not.available> - 2018-10-16 10:50 +0200
Re: Mysterious "Unknown runtime error" in a script in a HTA file "Mayayana" <mayayana@invalid.nospam> - 2018-10-16 09:34 -0400
Re: Mysterious "Unknown runtime error" in a script in a HTA file "R.Wieser" <address@not.available> - 2018-10-16 16:04 +0200
Re: Mysterious "Unknown runtime error" in a script in a HTA file "Mayayana" <mayayana@invalid.nospam> - 2018-10-16 10:28 -0400
Re: Mysterious "Unknown runtime error" in a script in a HTA file "R.Wieser" <address@not.available> - 2018-10-16 18:53 +0200
Re: Mysterious "Unknown runtime error" in a script in a HTA file "Mayayana" <mayayana@invalid.nospam> - 2018-10-16 14:25 -0400
Re: Mysterious "Unknown runtime error" in a script in a HTA file "R.Wieser" <address@not.available> - 2018-10-16 21:23 +0200
Re: Mysterious "Unknown runtime error" in a script in a HTA file "Mayayana" <mayayana@invalid.nospam> - 2018-10-16 16:04 -0400
Re: Mysterious "Unknown runtime error" in a script in a HTA file "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2018-10-16 22:38 +0200
Re: Mysterious "Unknown runtime error" in a script in a HTA file "Mayayana" <mayayana@invalid.nospam> - 2018-10-16 18:19 -0400
Re: Mysterious "Unknown runtime error" in a script in a HTA file "R.Wieser" <address@not.available> - 2018-10-17 09:30 +0200
Re: Mysterious "Unknown runtime error" in a script in a HTA file "Mayayana" <mayayana@invalid.nospam> - 2018-10-17 09:42 -0400
Re: Mysterious "Unknown runtime error" in a script in a HTA file "R.Wieser" <address@not.available> - 2018-10-17 21:59 +0200
Re: Mysterious "Unknown runtime error" in a script in a HTA file JJ <jj4public@vfemail.net> - 2018-10-18 02:10 +0700
Re: Mysterious "Unknown runtime error" in a script in a HTA file "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2018-10-17 21:36 +0200
Re: Mysterious "Unknown runtime error" in a script in a HTA file "Mayayana" <mayayana@invalid.nospam> - 2018-10-15 10:14 -0400
Re: Mysterious "Unknown runtime error" in a script in a HTA file "R.Wieser" <address@not.available> - 2018-10-15 17:33 +0200
Re: Mysterious "Unknown runtime error" in a script in a HTA file "Mayayana" <mayayana@invalid.nospam> - 2018-10-15 11:57 -0400
Re: Mysterious "Unknown runtime error" in a script in a HTA file JJ <jj4public@vfemail.net> - 2018-10-16 18:07 +0700
Re: Mysterious "Unknown runtime error" in a script in a HTA file "Mayayana" <mayayana@invalid.nospam> - 2018-10-16 09:58 -0400
Re: Mysterious "Unknown runtime error" in a script in a HTA file "Dave \"Crash\" Dummy" <invalid@invalid.invalid> - 2018-10-16 12:28 -0400
csiph-web