[thelist] Javascript LWP ?

James Hardy evolt at fraggle-rock.org.uk
Mon Oct 15 09:52:13 CDT 2001


>Is there a way to get a result from a cgi into a javascript variable ?

The way I get a serverside variable into client side script is to get it
to write a hidden input element with the contents of the variable. then
Javascript can just read it like a normal element

ie
<input type="hidden" name="variablename" value="Output your 0 or 1 here">

<button onclick="alert('Variablename='+variablename.value)">Click
here</button>

hope that helps
--
James Hardy







More information about the thelist mailing list