/    Sign up×
Community /Pin to ProfileBookmark

VBScript DHTML??

Hello –

I keep reading that in theory VBScript is DHTML capable, but can’t seem to find any info on this, tutorials, samples, etc, even on the MSDN site. Does anybody ACTUALLY use VBScript for DHTML?

I’ve found a few very extremely simple examples that use onmouseover event handlers, but nothing that actually accesses the DOM interface or creates DOM element objects – for example, how would I do this statement sequence in VBScript?

var d = document.createElement(“DIV”)
d.innerHTML = “foo”
document.body.appendChild(d)

Thanks for your thoughts, comments or suggestions!

  • Hnorris
  • to post a comment
    JavaScript

    18 Comments(s)

    Copy linkTweet thisAlerts:
    @khalidali63Mar 08.2003 — If VBScript does not support accessing DOM objects already then I seriously doubt that it will in future versions of IE.

    The reason I say this is,VBScript was just another try by MS to stop the exponential popularity of JavaScript,and now IE 6 being the most standard compliance browser by MS to date,it seems prety hard to believe that they will go the other way again.

    Plus since JavaScript that has complete accessibility to DOM objects already and you can read XML docs and HTML tree in a page,it would only make MS look worse in already notorious position they are.

    Cheers

    Khalid
    Copy linkTweet thisAlerts:
    @hnorrisauthorMar 08.2003 — Hi Dave -

    Thanks for your reply - can you possibly recommend any online samples or tutorials for VBScript based DHTML - I've found exactly one, the MSDN site, a tiny little onmouseover change color example - which is why I'm starting to suspect no one is actually using VBScript for DHTML...

  • - Hnorris
  • Copy linkTweet thisAlerts:
    @cyrusrynleeNov 23.2008 — Yes - VBSCRIPT fully supports DHTML hnorris, but is using a different DHTML DOM -Internet Explorer DOM-which is almost W3C compliant(meaning - some special things/elements that works with IE that will NOT work in other browsers)...almost since Microsoft always tries to show off new features and also because of the fact that IE is not only a browser, but is tightly integrated with Windows Operating Systems (e.g. Windows 2000/XP/2003/Vista/2008). VBSCRIPT is native to Windows OS and has the ability to use IE as an application interface to run, monitor, and control other system components and even other applications via HTA + DHTML.

    VBSCRIPT is designed for ActiveX,Active Directory,ASP (server-side scripting) and IE-only (client side scripting) users, developers, and customers. JSCRIPT (Microsoft's ECMA compliant scripting language that resembles JAVASCRIPT in form and syntax) is designed for server & client-side cross-platform use. khalidali63 doesn't see this. JSCRIPT extends its power to .NET programming and Windows OS scripting (even Active Directory but Microsoft has limited examples), something that JAVASCRIPT doesn't do (but that's fine since it's not designed to be for Windows-only machines).

    There are many VBSCRIPT-DHTML examples in MSDN - you just have to know how to search for the right words. Also, you can convert JSCRIPT (if you know how to do this then, perfect!) examples to VSBCRIPT and vice-versa. You just have to know how to spot differences between the two. For example:

    "DIM" (vbscript) is equivalent of javascript/jscripts' "var".

    document.getElementById("sample") (the same in VBscript, only it doesn't require a line termination character).

    VBscript is case-insensitive.

    Replace the "[]" with "()" as in the following example:

    alert(myselect.options[0].text); (jscript/javascript)

    msgbox(myselect.options(0).text) (vbscript)

    et cetera.


    Just remember to spot the difference, the DOM you'll be using (IE or W3C-your choice) and your target users and you'll be fine using it. khalidali63 didn't see the goals of Microsoft & how MS advertised their products...MS released vbscript and jscript almost at the same time but vbscript got more attention and criticisms simply because of the fact that it was a non-ECMA compliant scripting language. But I don't care about those issues as long as I can use the thing to my advantage, to improve my work,my life and the lives of others.
    Copy linkTweet thisAlerts:
    @felgallNov 23.2008 — Just remember that vbScript will only work for those of your visitors who are using IE and will be ignored by all other browsers.
    Copy linkTweet thisAlerts:
    @MrNobodyNov 23.2008 — ... which is why I'm starting to suspect no one is actually using VBScript for DHTML...[/QUOTE]
    You can also ignore what felgall had to say above because no-one in their right mind has *ever* tried to use VBScript in Internet-based web pages -- except in the case of employees accessing their own company's non-public websites from the Internet (in which case, the employees know to use IE). What too many people ignorantly ignore, is that MS never intended VBScript to be used on an Internet basis. IE, itself, is also not intended to be exclusively used on an Internet basis.

    MS caters to businesses. Such businesses have intranets. Such businesses also need their client-side scripting language to be able to interact more closely with the local and network environments. This is why JScript and VBScript has so much more capability than ECMA-Script. Lastly, such businesses are more likely to have VB, VBA, and VBScript programmers on staff.

    Thus, having VBScript as an alternate client-side scripting language in IE is an absolute must in an intranet environment. As such, VBScript uses the same browser DOM & DHTML as JavaScript does. The only basic difference is in how event handling is done. As for tutorials, you'll only get those from MS and, currently, .NET is the big thing which has pushed JScript and VBScript information off of their website. Now you'll basically only find that stuff included with specific program products or SDK's.
    Copy linkTweet thisAlerts:
    @felgallNov 23.2008 — You can also ignore what felgall had to say above because no-one in their right mind has *ever* tried to use VBScript in Internet-based web pages[/QUOTE]

    That's not true. Several years ago when IE6 had 98%+ of the browser market vbScript was quite workable for web pages on the internet. It is only in the past two years with IE's market share having fallen from being effectively the only browser in use to being only one of several alternatives that vbScript has become unsuited to internet use.
    Copy linkTweet thisAlerts:
    @MrNobodyNov 23.2008 — It is just as true that "no-one in their right mind has *ever* tried to use VBScript in Internet-based web pages" as it is true, even now, that no-one in their right mind makes their Internet-based web site dependent upon JavaScript. You say that IE6 had 98% of the market. I say that JavaScript is supported by 98% of the browsers in use. (Note that I said supported -- not necessarily enabled.) Thus, if you can't be 100% sure that your scripting language is going to be supported by 100% of your visitors, then no-one in their right mind is going to be dependent upon it.
    Copy linkTweet thisAlerts:
    @felgallNov 24.2008 — Relying on it isn't the same as using it.
    Copy linkTweet thisAlerts:
    @MrNobodyNov 24.2008 — I've made it a practice to look at the source code of practically every web site I've ever visited over the last 10 years of my web experience. We're talking about literally hundreds of web sites per year. I have used it many, many times in an intranet environment (and even had clients ask me to write VBScript for their intranet environments), but not once have I ever seen anybody using VBScript in an Internet environment. Obviously I cannot prove my point, to you, and you are therefore free to say what you like but, also, without proof.
    Copy linkTweet thisAlerts:
    @felgallNov 24.2008 — I have come across a number of web sites that use vbScript but not many and far fewer now than in the past.

    A couple of years ago when IE6 dominated the market using either vbScript or JScript or both in web pages actually worked for most visitors and so a lot of newbies used them. A lot of those have more recently been asking why their page doesn't work with browsers other than IE and the answer is just about always that it is because they used parts of JScript that can't also run as JavaScript. There is an occasional one that involves vbScript though as well - particularly from people wanting to know the JavaScript code for yes/no dialog boxes.
    Copy linkTweet thisAlerts:
    @MrNobodyNov 24.2008 — Newbies don't count -- they are not in their right mind (meaning, they haven't learned the facts, yet). Point out any existing professional web site using VBScript and you'll have proved your point. Until then, what you say is just words.
    Copy linkTweet thisAlerts:
    @felgallNov 24.2008 — Many of the people asking questions on this forum are newbies. While the person who asked the original question in this thread may not be a newbie the thread will be read by a lot of newbies and my comments about the use of vbScript on the web were intended to make sure that those people were appropriately educated.

    You need to remember that answers posted in forums are not only going to be read by the person who asked the original question but will also be read by a lot of other people who also want to know.
    Copy linkTweet thisAlerts:
    @MrNobodyNov 24.2008 — ... my comments about the use of vbScript on the web were intended to make sure that those people were appropriately educated.[/QUOTE]
    Then learn what proper education constitutes. The Boy Who Cried Wolf was just trying to educate those whom had not experienced what he had. But that education was all about a need for attention. By the same token, Chicken Little was trying to educate those whom had not experienced what he had. But that education was based upon false premises. He told the truth but blew it out of proportion and neglected to tell everything.

    Same in your case. If you only present the negative side of everything, then you are not an educator -- just a nay-sayer and, like the Boy Who Cried Wolf, what you have to say will have less and less impact upon those who need to hear it because you come off like a broken record. Instead, while presenting the negative side, also present the truth which includes the positive side -- in other words, don't just advise against the use of a thing, but also state the proper uses and places for such things.
    Copy linkTweet thisAlerts:
    @cyrusrynleeNov 24.2008 — We each have our own biased opinions, more biased when we constantly use or sell the products or technology we're talking about here;the point is that -these are tools that we can use and each is suited to work in a particular or variety of situations - we just have to pick one that will work to our advantage.

    I like them all (jscript/vbscript/javascript) but, we all know these technologies become obsolete over time and will be replaced by a better one.
    Copy linkTweet thisAlerts:
    @rnd_meNov 24.2008 — not once have I ever seen anybody using VBScript in an Internet environment.[/QUOTE]

    my bank uses it...

    https://ecom.busey.com/PBI_PBI1961/pbi1961.asp?Rt=071102568&LogonBy=Connect3&PRMAccess=Account&user=true

    its also a great way to hide script from non-ie browsers.

    plus you get that nice safeArray that all the kids want...

    it's also historivcally been faster, though JIT and tracemonkey will eliminate that.

    I personally find felgall's posts to be very informative though perhaps a little heavy-handed on the dogma.
    Copy linkTweet thisAlerts:
    @MrNobodyNov 25.2008 — I personally find felgall's posts to be very informative though perhaps a little heavy-handed on the dogma.[/QUOTE]
    My point.
    my bank uses it...

    https://ecom.busey.com/PBI_PBI1961/pbi1961.asp?Rt=071102568&LogonBy=Connect3&PRMAccess=Account&user=true[/QUOTE]

    I wonder why when that page is chock full of JavaScript and there is only this bit of VBScript?
    [CODE]<script language="vbscript">
    on error resume next
    If MSDetect = "true" Then
    For swVer = 2 to 6
    If Not (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & swVer))) Then
    Else
    flashinstalled = 2
    flashversion = swVer
    End If
    Next
    If flashinstalled = 0 Then
    flashinstalled = 1
    End If
    End If
    </script>[/CODE]

    Could it be they don't know that [B]CreateObject[/B] is equivalent to [B]new ActiveXObject[/B] in JScript?
    Copy linkTweet thisAlerts:
    @rnd_meNov 25.2008 — 
    I wonder why when that page is chock full of JavaScript and there is only this bit of VBScript?[/QUOTE]


    i think its a fossil. notice the language 1.2 attribs also.

    Given that ecmaScript runs everywhere and vbscript runs about half of everywhere, rapidly shrinking due to new browser categories like cellphones, choosing a scripting language to invest a lot of time with is not terribly difficult.


    ----------
    i'd like to clarify my comments re felgall as well.

    I think that he has a different philosophical approach than many others.

    I think that what he says is, broadly speaking, far more true than not.

    If we are running a fine-toothed comb made up of proprietary, bleeding-edge, beta, or deprecated techniques, we can likely find exceptions to any generalizations.

    just because i can drive a car using my feet to steer doesn't make it a good idea.

    the forum model of communication complicates the matter, due to the fact that a lot of terms, even simple terms like "javascript" mean several things in different contexts. in vocal conversation such ambiguities are instantly worked out, and it is mutually understood whether you were talking about the Mozilla copyright language, ecmaScript as a whole, etc...

    Everybody always wants to be "right", but being correct is not always being helpful.

    I think his contribution to this forum in incalculable.

    It really takes all kinds, and i appreciate his posts, even if i don't agree 100&#37;.

    if everyone agreed on everything all the time, we probably wouldn't need a forum like this, and we obviously wouldn't even have vbscript for that matter.
    Copy linkTweet thisAlerts:
    @MrNobodyNov 25.2008 — ... we obviously wouldn't even have vbscript for that matter.[/QUOTE]
    Incorrect. By your premise, the reverse is actually true. Meaning, Netscape would have agreed that Visual Basic, rather than C/Java, was the choice on which to model a client-side scripting language. You see, Visual Basic predates JavaScript and as MS caters to companies, it was a given that MS had to make Visual Basic into a scripting language (once scripted browsers became a technology concept) as those companies already had billions of dollars invested in such programming talent.
    ×

    Success!

    Help @hnorris spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.18,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...