I'm trying to use PhantomJS to scrape a website meanwhile using Tor to change my IP address. I'd like to know is there a way to request new Tor identities in Javascript. I've seen this question but cannot understand how to use AJAX to do it.
You don't exactly "do it in AJAX". Rather, you use AJAX to call a server side script that does whatever it is you are trying to do. In this case that means writing an AJAX request to a PHP script that calls the function you linked to.