Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

call cgi from javascript - Do not leave web page

Avatar of speedygonzalez
speedygonzalez asked on
JavaScriptWeb DevelopmentScripting Languages
15 Comments1 Solution3023 ViewsLast Modified:

I have a web page in which I will have a number of links for whch I will call CGI scripts when each link is clicked.

What I need to do is (a) call the cgi script when the button or link is clicked but do not leave the webpage when this occurs (i.e. stay on the same page but do not show a refresh to the web user. (b) check if the user is still pressing on the mousebotton (i.e. has not released the button pressed) & recall the cgi script again if required after a period of time if the mouse button is still clicked)

Sounds complicated I know.

The following was my first attempt (just using one web client button for testing)

function callCgi() {
   location = '../../Scripts/testC.cgi'
<INPUT TYPE="button" onClick="callCgi();" VALUE="Run">

When I click on the button the testC.cgi script does execute as required, however the page then moves to testC.cgi and does not stay on the same client page.

I'm not sure if what I'm asking is in fact possible but thought I'd check anyhow.

Any help would be very much appreciated!
Avatar of Frederick McIntyre
Frederick McIntyreFlag of United States of America imageProgrammer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

This problem has been solved!
Unlock 1 Answer and 15 Comments.
See Answers