moving AJAX into wndx.js file