I want to do something like the following:
function StatusBox() {
this.connectionStatus = $("#connectionStatus");
}
StatusBox.nosupport = function(type) {
StatusBox.connectionStatus.html('<span style="color: red;">' + NO_SUPPORT + '</span>');
};
StatusBox.error = function(type) {
StatusBox.connectionStatus.html('<span style="color: red;">' + ERROR + '</span>');
};
But I get Uncaught TypeError: Cannot read property 'html' of undefined
How do I reuse $("#connectionStatus")
in the child functions?
Comments
Post a Comment