Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You might find it easier to use the <a href="http://jquery.com/" rel="nofollow">jQuery</a> library in your Javascript, as that allows you to write your client-side code more succinctly. (Note that I like to put links used in my Javascript in the <code>&lt;head&gt;</code> section and then pull them in by reference as this aids debugging in complex cases.)</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;script src="jquery.js"&gt;&lt;/script&gt; &lt;link id="timer" href="time.tcl" /&gt; &lt;/head&gt; &lt;body&gt; &lt;form action=""&gt; &lt;input value="Get Time" type="button" onclick="showCurrentTime();" name="GetTime"&gt; &lt;div id="result" align="center"&gt;&lt;/div&gt; &lt;/form&gt; &lt;script language="Javascript"&gt; var timerURL = $("#timer")[0].href; function showCurrentTime() { $.get(timerURL, function(response) { $("#result").html(response); }); } &lt;/script&gt; &lt;/body&gt; </code></pre> <p>Next, you need to check what the content type of the response from the server is. You <em>should</em> make sure that it is <code>text/plain</code> if I've understood what you're trying to do in this case. If I've read the documentation for <a href="http://panoptic.com/wiki/aolserver/Ns_respond" rel="nofollow"><code>ns_respond</code></a> right, you want to do something like:</p> <pre class="lang-tcl prettyprint-override"><code>ns_respond -type "text/plain" -string [clock format [clock seconds]] </code></pre> <p>More generally, returning JSON is often even more useful though you then want slightly different techniques for displaying it.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload