None, it is typically just used to display HTML on the client-side of the application. Unless you read the innerHTML and send the content to the server, then you would simply need to take the typical precautions in your server-side code.
<a href="http://www.krishadlock.com" target="_blank" rel="nofollow">www.krishadlock.com</a><br /><a href="http://www.krishadlock.com/blog" target="_blank" rel="nofollow">www.krishadlock.com/blog</a><br /><a href="http://www.studiosedition.com" target="_blank" rel="nofollow">www.studiosedition.com</a><br /><a href="http://www.amazon.com/exec/obidos/redirect?link_code=as2&path=ASIN/0672329123&tag=krishadlock-20&camp=1789&creative=9325" target="_blank" rel="nofollow">Ajax for Web Application Developers</a>
Joined: Jul 26, 2005
What is better to create a table?
Joined: Nov 14, 2006
Originally posted by Bear Bibeault: And a combination approach (server-side to initially create the construct, and client-side objects to control it) is also possible and frequently the best of both worlds.
My other option which I tried was creating all the HTML in server side code and then passing the HTML from a StringBuilder back to the client to simply pop in a DIV with innerHTML. This worked, but the intrececies (Sp?) of generating HTML in Java code was too much and would soon become a nightmore to maintain. Reminded me of some old school web development before the big MVC boom. Then Bear suggested something that I was finally able to try out and it worked great!
Ajax calls one of my actions on the server. The action forwards the request to a JSP which I use to render the HTML. This response is sent back to the browser in the ajax object which I then simply pop onto the page using innerHTML.
I suppose a next logical concern about the above approach is, if we are transmitting HTML back to the client, and it's a lot, then why not just refresh the entire page?
Typically, the amount of HTML sent back to the client is less than what would be required on a full page refresh or typically request/response. Also, I am in a situation where there is a Java applet running some proprietary flash app that I don't want to refresh everytime the page loads.
The other option was HTML Frames. Bleh! I just threw up in my mouth a little.
As always, weight the pros and cons of any ajax solution to make sure you aren't using it to be using it and making things more difficult for yourself.