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:
0 Comments
Leave a Reply. |