JavaScript is an interpreted computer programming language. As part of web browsers, implementations allow client-side scripts to interact with the user, control the browser..etc..and you must reload the webpage that contained script to see what's going on.
Ajax is a group of interrelated web development techniques used on the client-side to create asynchronous web applications. AJAX is about updating parts of a web page, without reloading the whole page and you can see results immediately.
Hope it's useful to you!