Eric,
Yes, I changed the jev_get to `jev_get=: create` and then decommented
(they were commented in the previous version) the following two lines in
JS. Can you see what I can do now, please?
function ev_command_enter(){jdoajax(["command"],"");}
function ajax(ts) {jbyid("command").value=ts[0];}
*** event handler error
ev_command_enter 0
|syntax error: jev_tgsj_
| ev_command_enter 0
jdo jev_tgsj_ 0
jtype enter
jmid command
jsid
command fd 10
jdata
jwid
┌───────┬───────────┐
│jdo │jev_tgsj_ 0│
├───────┼───────────┤
│jtype │enter │
├───────┼───────────┤
│jmid │command │
├───────┼───────────┤
│jsid │ │
├───────┼───────────┤
│command│fd 10 │
├───────┼───────────┤
│jdata │ │
├───────┼───────────┤
│jwid │ │
└───────┴───────────┘
*** response not sent for tgsj
On Mon, Mar 3, 2014 at 11:13 AM, Eric Iverson <[email protected]>wrote:
> Shooting from hip response without a careful reading of your message.
>
> jev_get is for the http get request. It is the verb that is run when
> you first browse to that page. It is not a response to an ajax
> request.
>
> What is the J definition for ve_command_enter? When jev_get is called
> it will get the error you indicate if the J verb ev_command_enter is
> not defined.
>
> Note that in general there are both javascript and J definitions with
> the same names.
>
> Look more carefully at the patterns in working J examples. It is
> likley that jev_get should be defined to be create.
>
> On Mon, Mar 3, 2014 at 11:07 AM, Brian Schott <[email protected]>
> wrote:
> > I have problem code inside a JHS app I am trying to write. The app will
> > accept user inputs of valid commands like `fd 10` and produce canvas draw
> > updates.
> >
> > This line in jijx is producing the error below it.
> >
> > load'~Projects/tgsjhs/tgsjhs.ijs'
> > |syntax error
> > | jev_get_tgsj_''
> > *** response not sent for tgsj
> > *** html409 Conflict
> >
> >
> > *********code is below*********
> > HBS=: 0 : 0
> > '<h2>Type in a turtle command</h2>'
> > 'command' jhtext 'fd 10';50
> > '<canvas width="600" height="600" id="glcanvas"></canvas>'
> > )
> >
> > create=: 3 : 0
> > 'tgsj'jhr''
> > )
> >
> > jev_get=: ev_command_enter
> >
> > CSS=: 0 : 0
> > body{margin:10px;}
> > )
> >
> > JS=: 0 : 0 NB. javascript
> > function ev_body_load(){init();} // must use JHS framework load handler
> > // function ev_command_enter(){jdoajax(["command"],"");}
> > // function ajax(ts) {jbyid("command").value=ts[0];}
> > )
> >
> > *********code is above*********
> >
> > Thank you,
> >
>
--
(B=)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm