Automatic rendering on post request

So I have made a system where when a user visits the render page, all items that the person’s character is wearing are fetched and then worn on its avatar, then saved in a directory. I want to skip the visiting part, and just want to make it so that when a person clicks the render button, the avatar is rendered and previewed. I tried to use jQuery post request and try it but it didn’t work. How can I modify so that a simply request renders my users avatar?

Sorry, it’s not clear what you are asking for since your problem description is very vague. Consider to share your code as a live example or GitHub repo.