[Grace-core] Backstop
Prof. Andrew P. Black
black at cs.pdx.edu
Wed Jun 8 15:46:15 PDT 2016
> On 7 Jun 2016, at 21:58 , Timothy Jones <tim at ecs.vuw.ac.nz> wrote:
>
>
> On 08/06, Andrew P. Black <black at cs.pdx.edu> wrote:
>> It stops the backspace key from making Chrome go “back” to the
>> previous web page, which is really annoying when you think you are
>> editing a Grace program in the browser-based editor.
>
> You can also implement this directly on the page with something like:
>
> document.addEventListener("keydown", function (event) {
> if (event.which === 8) {
> event.preventDefault();
> }
> });
Good to know. We should just do this — as should _every_ web page with a fillable form!
Incidentally, what is the _right_ way to get hold of the grace-web-editor session from within the JavaScript that is running on the web page?
Andrew
More information about the Grace-core
mailing list