I had two javascript functions that added text input values to an input type=select between <script> tags.
After I added one more function, the above functions stopped working. I found that the error was that I had forgotten the 0 in the if logical block. But this function with an error was at no point executed.
The thing I want to know is why would a function that is not called cause other functions to not operate?
Code of javascript functions that workedfunction addCompanyFunction() {
var x = document.getElementById("companylist");
var txt = document.getElementById("taname");
var option = document.createElement("option");
if (txt.value != "") {
option.text = txt.value;
x.add(option, x[0]);
}
}
function addCultFunction() {
var x = document.getElementById("cultlist");
var txt = document.getElementById("cultname");
var option = document.createElement("option");
if (txt.value != "") {
option.text = txt.value;
x.add(option, x[0]);
}
}
After adding the following function with its error the other functions stopped working
function filled_out(dict) {
var i;
if (dict.length > ) { //<--- the zero is missing which caused the problem
for (var key in dict) {
if (dict[key] == "") {
return true;
}
}
return false;
}
return false;
}