var when = require("whenjs")
// Later
when(function(){
return true == true; // The Condition.
}, function(){
alert("True == True!"); // When The Condition Is True
})
Simply download when.js
, then include <script src="when.js" type="text/javascript"></script>"