Can I emulate it in my own code?
Is it your forum?
If not, the forum may not see CORS headers, and so browsers will refuse to send the Ajax requests.
If it is your forum, you will have to either host the webpage on the same domain, or else find out how to set a CORS header that will allow Ajax requests from your webpage domain.
The only other way would be to proxy the Ajax requests through a server. This will make it somewhat slower, and would almost certainly then violate the forum's terms and conditions. (If they WANTED anybody to be able to scrape their content with Ajax, they would have a CORS header allowing all.)