Irrelon / jquery-lang-js

i18n Allow instant language switching on HTML pages without reloading the page.
https://www.irrelon.com
362 stars 132 forks source link

jquery-lang.js: 80 Line Number 'fn undefined #104

Closed pvnkk closed 7 years ago

pvnkk commented 7 years ago

Uncaught TypeError: Cannot read property 'fn' of undefined at Lang.init (jquery-lang.js:80) at index.html:21

abdullaziz89 commented 7 years ago

i have the same error !!! anyone can have answer for this ??

Irrelon commented 7 years ago

Did you guys take a look at the code on line 80? It is extending jQuery. If $ is not defined then it will not work. You need to load jQuery first.

abdullaziz89 commented 7 years ago

the problem not in $ sign .. its on 'fn' of iundefined !!! the jquery already loaded

Irrelon commented 7 years ago

But the error is "Cannot read property 'fn' of undefined"

That means it is trying to access the 'fn' property of the $ object and cannot... which means that $ is undefined.

abdullaziz89 commented 7 years ago
screen shot 2017-08-10 at 6 41 13 pm
Irrelon commented 7 years ago

Fixed by https://github.com/Irrelon/jquery-lang-js/commit/af68d4ae776a971914b2bf5aef4e05acebf16d21 - the issue was that jQuery was no longer being passed into the lang library by the initial call so $ was undefined.

This was caused by a previous pull request. I've fixed the code. Please download the latest version.