Use one javascript variable into another javascript file

Please simply place commonJs var outside the jQuery function and try again. It will work for you.