The problem was decribed here http://stackoverflow.com/questions/898040/problem-to-have-access-to-jquery-plugin-inside-document-ready tested with jQuery 3.2 and 2.6