Javascript Jquery Then Not Working As Expected Stack Overflow

Javascript Jquery Then Not Working As Expected Stack Overflow