server-side vbscript call with javascript client-side

  • Thread starter David Shorthouse
  • Start date
D

David Shorthouse

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
 
B

Bob Barrows [MVP]

David said:
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
 
M

Mark Schupp

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,815
Latest member
treekmostly22

Latest Threads

Top