I have the following Javascript code which has been working for over 10 years and still works on Chrome, but does not work on FF 73.0 on Ubuntu Linux.
```
/**************… (funda kabanzi)
I have the following Javascript code which has been working for over 10 years and still works on Chrome, but does not work on FF 73.0 on Ubuntu Linux.
```
/************************************************************************
* timer *
* *
* This timer is started whenever the user presses a key in the input *
* field and pops if 0.9 second passes without a new keystroke *
************************************************************************/
var timer = null;
/************************************************************************
* function onKeyDownName *
* *
* This method is called when a key is pressed in the Name field. *
* A timer is set so that when the user stops typing the selection *
* list is repopulated. *
* *
* Input: *
* event if passed, event.keyCode identifies the key pressed *
* in older releases of Internet Explorer use window.event *
************************************************************************/
function onKeyDownName(event)
{
if (timer)
clearTimeout(timer);
timer = setTimeout(update, 900);
} // function onKeyDownName
/************************************************************************
* function update *
* *
* This method is called when the user stops typing to repopulate *
* the selection list based upon the current contents of the Name *
* field. It is also the onchange method for the following fields: *
* 'birthmin', 'birthmax', 'incMarried', 'includeParents', *
* 'includeSpouse', and 'Sex', and it is called by the onchange *
* method for the field 'treeName'. *
************************************************************************/
function update()
{
var form = document.nameForm;
if (form)
{ // form present
var url = "/FamilyTree/getIndivNamesXml.php";
... code to complete url by appending values of elements from form
// invoke script to obtain list of names for selection list
HTTP.getXML(url, // see O'Reilly Javascript
gotNames,
noNames);
// clear out the old selection list while we are waiting
var select = form.individ;
select.options.length = 0;
// put a dummy entry at the top of the selection, otherwise
// selecting the first name does not call onchange
var name = '[choose an individual]';
var option = new Option(name,
-1,
false,
false);
option.innerHTML = '[choose an individual]';
select.appendChild(option);
} // form present
else
alert("nominalIndex.js:update: cannot find form");
} // function update
```
When I put alerts into nameOnKeyDown and update I see that nameOnKeyDown is called but update is never called.
You can see the above code in action at https://www.jamescobban.net/FamilyTree/nominalIndex.php?name=allenby,%20a&treename=&lang=en
This code has worked for over 10 years, and still is working today on Chrome, but the timer never pops on Firefox 73.0 on Ubuntu Linux 19.10.