victorjonsson / jQuery-Form-Validator

[DISCONTINUED] jQuery plugin that makes it easy to validate user input while keeping your HTML markup clean from javascript code.
972 stars 476 forks source link

Languages wrong url #641

Open galdazbiz opened 7 years ago

galdazbiz commented 7 years ago

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 commented 7 years ago

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

gartenumgraben commented 4 years ago

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.