This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
First let me ask you a question. Are you using JSP and JSF together? If you are then, the element ID which you are giving as an argument to java script might be different from the "content" when it is transformed to html code in the background. Try looking at the source of the page and see if the ID of the element is same as "content". If it is different then you need to give that ID to java script.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com