The javascript handler should be more like (from your earlier example): function ev_command_enter(){jdoajax(["command"],"");}
On Mon, Mar 3, 2014 at 7:32 PM, Eric Iverson <eric.b.iver...@gmail.com> wrote: > Try some javascript debugging. Put in a javascript sentence in the > javascript method ev_command_enter: > alert("wrong number of ajax results"); > This will confirm that at least javascript is seeing the event. > > There might be hints in the jijx window. > > Using submit() in the handler is probably wrong. Follow the pattern > from other JHS pages that work. > > On Mon, Mar 3, 2014 at 7:27 PM, Brian Schott <schott.br...@gmail.com> wrote: >> Eric, >> >> It appears my ev_command_enter is NOT being triggered by pressing the Enter >> key while in the text field. I have even placed a debugging counter, T, in >> ev_command_enter, but it is not being incremented. >> >> Could you or others look at the excerpt of code below, please? I have >> patterned it after both Eric's demogl1.ijs and Bob's vlitejwiki.ijs, but >> cannot seem to get over this bump in the road. >> >> >> coclass'tgsj' >> coinsert'jhs' >> >> HBS=: 0 : 0 >> '<h2>Type in a turtle command</h2>' >> 'command' jhtext 'fd 10';50 >> '<canvas width="600" height="600" id="glcanvas"></canvas>' >> ) >> >> jev_get=: create >> >> create=: 3 : 0 >> 'tgsj'jhr'' >> T=: 20 >> initTurtles 1 >> ) >> >> ev_command_enter=: 3 : 0 >> T=:T+1 >> s=: getv 'command' >> ". s >> ) >> >> JS=: 0 : 0 NB. javascript >> function ev_body_load(){init();} // must use JHS framework load handler >> function ev_command_enter(){jsubmit();} >> ) >> >> Thanks, >> >> On Mon, Mar 3, 2014 at 11:13 AM, Eric Iverson >> <eric.b.iver...@gmail.com>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 <schott.br...@gmail.com> >>> 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********* >>> >> >> >> -- >> (B=) >> ---------------------------------------------------------------------- >> For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm