Whenever the prototype for goingOutChecker()
works correctly and I call it within the GeneralChecker()
function, I want the Success!
and Oops!
banners to display at the top of the browser. However, if I comment out the goingOutChecker()
prototype and function call, the
monthlyBillCheckerAndSalaryChecker()
prototype and its call work flawlessly. Essentially, both banners should appear as expected when the user clicks 'Submit' provided that the first two fields are either filled in correctly or incorrectly.
I'm wondering why the goingOutChecker()
prototype doesn't work properly when I call it inside the GeneralChecker()
function. In other words, why don't the banners appear when all three fields are filled in correctly or incorrectly?
It's worth noting that no errors are appearing in the console.
Below is a snippet from the gameTime.html
file:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>WOMP</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="gameTime.css">
</head>
<!-- Rest of HTML content goes here... -->
For more details on this issue, check the complete gameTime.js
file below:
function GeneralChecker(salary, fixedExpense, variableExpense) {
var self = this;
self.salary = salary;
self.fixedExpense = fixedExpense;
self.variableExpense = variableExpense;
self.isSalaryZeroOrLess = function() {
// Function implementation code goes here...
}
// Other functions defined within the GeneralChecker prototype go here...
}
// Finally, an instance of the GeneralChecker class is created and initiated upon button click.