Based on code similar to the below javaScript, I am wanting to be able to use panelDNS.cache.propertyName to cache several commonly used jQuery Selectors
The problem is it seems I need to wrap it inside of $(document).ready(function() { ) for it to work.
Im just learning JS so I am not sure how I can do this and keep my short panelDNS.cache to access these values?
To clarify my question. Since panelDNS.cache is not a Function that I can Call inside my init function, I need to figure out how to make sure the DOM is loaded before panelDNS.cache gets called or ran
var panelDNS = {
unsavedChanges: false,
init: function () {
$(document).ready(function () {
PanelDNS.events();
});
},
cache: {
dnsTitleId: $("#dnsTitle"),
translation: {
absolute: 0,
relative: 0,
sinceDirectionChange: 0,
percentage: 0
}
},
events: {
}
}