Have the server respond with the necessary info but generate the style client side instead of server side. There doesn't appear to be any need to make trips back to the server to change styles.
You're right - I could just pass the variables as JS to the client, then assemble the final citation there. Great idea! Regarding the trailing slash, that's a regex problem, and I will solve it! Nice catch.
Also, "http://google.com" complains about robots.txt, but "http://google.com/" (trailing slash) does not.