Calling VBScript from JavaScript

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ian Sedwell

    Calling VBScript from JavaScript

    Hi guys

    Many thanks to all who replied to my original question. Actually, it's dead
    easy and the way I was doing it was correct the first time. You do indeed
    simply call the VBScript routine from the JavaScript routine. It doesn't
    matter whether the scripts are in external files, or embedded in the HTML
    document, so long as the VBScript is loaded before it is called from
    JavaScript - obviously.

    The VBScript routine can return a result to the calling JavaScript. If that
    result needs to be stored, then it can go into a JavaScript global, a hidden
    field in a frame, or a cookie depending on the operational requirement.

    Where I was going wrong was allowing non-MSIE browsers to get to see the
    VBScript at all. They always baulked at it. So all I did was introduce a
    simple test to check what sort of browser I was dealing with and then load a
    page that was pure JavaScript for non-MSIE browsers, or a different page
    that was JavaScript plus VBScript for the MSIE crowd. Perhaps someone knows
    of a way of hiding VBScript from non-MSIE browsers to allow a more elegant
    solution.

    Anyway... I have a working product and a happy client.

    As a rider, some of you were concerned that PDFs should be being loaded into
    a browser page for a variety of pretty good reasons, mostly concerned with
    the time it takes to load, etc. To set your minds at ease, the project was
    for a client to use over an intranet using a mix of MacOS and Windoze
    platforms.

    Have fun!

    Ian

  • kaeli

    #2
    Re: Calling VBScript from JavaScript

    In article <BCF076E0.883B% ian.sedwell@btc lick.com>,
    ian.sedwell@btc lick.com enlightened us with...[color=blue]
    >
    > Where I was going wrong was allowing non-MSIE browsers to get to see the
    > VBScript at all. They always baulked at it. So all I did was introduce a
    > simple test to check what sort of browser I was dealing with and then load a
    > page that was pure JavaScript for non-MSIE browsers, or a different page
    > that was JavaScript plus VBScript for the MSIE crowd. Perhaps someone knows
    > of a way of hiding VBScript from non-MSIE browsers to allow a more elegant
    > solution.
    >[/color]

    As I said in my other post. Conditionals for IE only. Much better than
    "browser detection".
    Modify this to call your VBScript.

    <!--[if IE 5]>
    <SCRIPT LANGUAGE="Javas cript">
    alert("Congratu lations. You are running IE5 or later!");
    </SCRIPT>
    <P>Thank you for closing the message box.</P>
    <![endif]-->

    --
    --
    ~kaeli~
    The secret of the universe is @*&^^^ NO CARRIER



    Comment

    Working...