Joe,

I noticed the `{}` at the end of your function ev_body_load(){} command.
Mine was missing that, and maybe the `init();` that was in my original was
wrong. Anyhow, I am not executing the ev_command_enter and I can move on.

Great tiny step.
Thanks,


On Mon, Mar 3, 2014 at 11:40 PM, Joe Bogner <joebog...@gmail.com> wrote:

> Brian, I see you switched to trying ajax in your latest version. I can
> take a look at it tomorrow. Here's the version from your previous
> message. It correctly fires ev_command_enter on my chrome browser when
> I hit enter. It also returns the result of the evaluation:
>
> I suspect your ajax version had the same issue. You need to return a
> valid HTTP response from the POST or ajax response. In this case, I am
> calling create with the parameter evaluated from ev_command_enter. The
> valid HTTP response is created and output using jhr
>
> coclass'tgsj'
> coinsert'jhs'
>
> HBS=: 0 : 0
> '<h2>Type in a turtle command</h2>'
> 'command' jhtext '1+1';20
> 'Result: <RESULT>'
> '<canvas width="600" height="300" id="glcanvas"></canvas>'
> )
>
> jev_get=: create
>
> create=: 3 : 0
> 'tgsj'jhr'RESULT';y
> T=: 20
> )
>
> ev_command_enter=: 3 : 0
> T=:T+1
> s=: getv 'command'
> ret=:". s
> NB. return valid HTTP response
> create ": ret
> )
>
> JS=: 0 : 0 NB. javascript
> function ev_body_load(){} // must use JHS framework load handler
> function ev_command_enter(){jsubmit();}
> )
>
> --
(B=)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to