jQuery-Form-Validator icon indicating copy to clipboard operation
jQuery-Form-Validator copied to clipboard

Languages wrong url

Open galdazbiz opened this issue 8 years ago • 2 comments
trafficstars

I've found in several versions for example: //cdnjs.cloudflare.com/ajax/libs/jquery-form-validator/2.3.77/jquery.form-validator.min.js

The js is calling languages in the wrong directory, it points to https://cdnjs.cloudflare.com/ajax/libs/jquery-form-validator/2.3.77/lang/lang/es.js

when it should be https://cdnjs.cloudflare.com/ajax/libs/jquery-form-validator/2.3.77/lang/es.js

That's causing that all my forms have stop working.

Thank you!

Regards

galdazbiz avatar Sep 14 '17 10:09 galdazbiz

hmm apparently the problem is happening just when I create DOM inputs.. now I'm not sure where the problem comes from

galdazbiz avatar Sep 14 '17 11:09 galdazbiz

I found the same problem which accours if one initializes the validation multiple times e.g. after an ajax call.

If the specified lang was loaded initialy using "../lang/es.js"

the next call of "findScriptPathAndLoadModules" will look for that very script call in order to usi its base path for further calls

this.src.substr(0, this.src.lastIndexOf('/')) + '/'

which will be "../lang/". To that it will append the module which is (in case of languages) "lang/es.js" resulting in the wrong "lang/lang/..." path.

gartenumgraben avatar Feb 27 '20 10:02 gartenumgraben