How can I make a cgi script be executed when a javascript function is called? Currently I am using a small iframe and loading the cgi script there, but it does not seem to be working. here is a snippet of code:
function back()
{
document.getElementById("hidden").src="scripts/backImage.cgi";//execute background script
document.getElementById("scan").src="scripts/getImage.cgi";//reload the display iframe
}
You can use XMLHttpRequest to trigger access to your cgi script.
You can use jQuery.ajax, or the shorthand:
jQuery.get("scripts/backImage.cgi");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With