![initialize outlook version is not defined initialize outlook version is not defined](https://lazyadmin.nl/wp-content/uploads/2020/05/Outlook-Inbox-with-topic-card-1024x683.png)
Leverage Undefined ValuesĪnother more slightly involved example involves calling a function with an optional parameter and then checking to see if that argument is defined when the function is called.įor example, let’s say that we know that the function in question will be called at two points within the page lifecycle: If that’s the case, most frameworks and applications provide an API for setting the order in which files are loaded, setting dependencies, and then defining where, in the page, they are loaded.
![initialize outlook version is not defined initialize outlook version is not defined](https://www.iclarified.com/images/tutorials/14356/49352/49352.png)
This means that either the scripts are placed after yours in the head element of the page or they are being loaded in the footer of the page. To fix this, it’s generally a problem of the files being loaded out of order and this is especially true if the error is being thrown in the context of a site or web application that has its own libraries, then the scripts are probably loading later than your own. Load the Libraries in Proper OrderĪrguably, the most popular reason for seeing a ReferenceError has to do with the fact that our script is referencing a variable that has yet to be defined. Instead, the problem can usually be resolved in one of two ways. The thing is, simply restoring a variable or giving it a definition especially when it’s related to a third-party dependency is not as easy. Old references of $ are saved during jQuery initialization noConflict() simply restores them.īut that’s getting beyond the point of this article. For example, given the example with jQuery above, we can make a call to noConflict() to restore the variable. “JavaScript Reference Error is Not Defined”Īs mentioned, there are times in which simply defining a variable will resolve the issue. In some cases, this can be simply referring to a variable that isn’t defined (perhaps the most popular is when jQuery’s $ function has been dereferenced and you’re trying to use $) and simply needs a definition.īut, in other cases, there are times where it may not be as simple. If you’re working on any type of web site or web application that has any other dependencies either for its front-end framework – such as Bootstrap and Foundation – or from the site’s foundation – such as Rails or WordPress – there’s a chance that your own JavaScript sources may result in the following: