server-side vbscript call with javascript client-side

Discussion in 'ASP General' started by David Shorthouse, Feb 2, 2005.

  1. Hey folks,

    Not an off-topic posting.....since I was shot-down in an earlier
    post...this one's legit.

    How do I go about calling a server-side vbscript within a client-side
    javascript function? What I have is a page heavy on the javascript that has
    a number of functions, one of which is to begin a visual countdown with an
    onclick and also open an asp page containing the server-side vbscript, which
    initiates a wake-on-lan call. I had no idea how to call the vbscript within
    the javascript function, so this is why I opted for the vbscript asp page
    "pop-up" via window.open.

    Here's a sample of the javascript function that gets called with an onclick:

    function fnHide1(){
    DavidWakeUp_window =
    window.open("davidwakeup.asp","mywindow","status=no,width=0,height=0");
    window.focus();
    window.setTimeout("fnHide2()",20000);
    setTimeout('countDown()');
    window.setTimeout('DavidWakeUp_window.close()',5000);
    }

    And the asp page, davidwakeup.asp is something like:

    <%
    set objWOL = CreateObject("UltraWOL.ctlUltraWOL")
    objWOL.BroadcastAddr = "192.168.2.255"
    objWOL.MACAddr = "00-00-00-00-00-00"
    objWOL.WakeUp
    %>

    Is it possible to just make this vbscript a sub function and then call the
    function within the javascript function hence eliminating the window.open
    pop-up?

    Thanks for any advice,

    Dave
     
    David Shorthouse, Feb 2, 2005
    #1
    1. Advertising

  2. David Shorthouse wrote:
    > Hey folks,
    >
    > Not an off-topic posting.....since I was shot-down in an earlier
    > post...this one's legit.
    >
    > How do I go about calling a server-side vbscript within a client-side
    > javascript function?


    Sorry, but client-side questions belong in a client-side newsgroup.
    ..scripting.jscript should work for you.
    In the meantime, look up the XMLHTTP object.

    It's also possible by setting an IMG element's src to the asp page that you
    wish to run.

    Bob Barrows

    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
     
    Bob Barrows [MVP], Feb 2, 2005
    #2
    1. Advertising

  3. David Shorthouse

    Mark Schupp Guest

    Another option is to use a frameset with a "hidden" frame (width="1") and
    have the javascript code load the ASP page into the hidden frame.

    --
    Mark Schupp
    Head of Development
    Integrity eLearning
    www.ielearning.com


    "Brian Staff" <brianstaff@[NoSpam]compuserve.com> wrote in message
    news:...
    > Dave,
    >
    > client-side scripts and server-side scripts actually sit on two distinct
    > machines, so they cannot "call" each other.
    >
    > You can however, make an HTTP request using client-side script and the

    XMLHTTP
    > Request object to send a request to the server where it will execute the
    > serve-side script.
    >
    > Search on this NG or the JScript NG for an example.
    >
    > Brian
    >
     
    Mark Schupp, Feb 3, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?bGFuZW0=?=
    Replies:
    3
    Views:
    29,361
    Eliyahu Goldin
    Mar 30, 2005
  2. Eitan
    Replies:
    2
    Views:
    550
    Eitan
    Jun 4, 2005
  3. alan
    Replies:
    2
    Views:
    6,481
  4. COHENMARVIN
    Replies:
    2
    Views:
    899
    Jason Kester
    Oct 20, 2005
  5. Replies:
    2
    Views:
    293
Loading...

Share This Page