I am doing late hours in office because of AJAX. Well not exactly AJAX but becasue of the rendering of the page. So I wanted to know when to use Ajax.
This is my first AJAX module. I am using AJAX to render a data grid, basically a table inside a div. I thought it would be easy as I did a few simple excercises to get a feel. Well as far as AJAX's data fetching is concerned it's OK. The problem comes in when you need to render the response. The thing is you need to explicitly tell everything how it should be rendered. Rendering a whole table on fly is @#$@$@. Then as if it was not enough then you have different browser (mainly IE and non-IE) issues.
The good thing about it was that I learnt a lot about DOM. So does anyone has a list of do's and don'ts for AJAX usage?
And yeah as two posts won't let me win two books, appending a totally unrealated question here only .
[ April 12, 2007: Message edited by: Anupam Sinha ] [ April 12, 2007: Message edited by: Anupam Sinha ]
The whole table is created on the fly. The table head can be one of the two forms. The table body is that part that needs to be data to be dynamically populated. Secondly the table also changes dynamically. I mean the head the no. cols. changes dynamically.
Parsing XML documents on the client using DOM is no fun - I sympathise with you there.
You need structured data for the grid body, but if XML is causing problems, have you looked at JSON as an alternative? And, if you do decide to use XML, have you looked at XPath and XSLT as ways of simplifying the process? Chapter 2 deals with these issues, and gives examples of how XPath can take the pain out of XML handling.
Thanks for the reply. The first thing after your reply I noticed was your signature. You seem to be quite an authority on AJAX. Well thanks for the sympathy. I have my whole team's sympathy with me. Yeah I was told about XSLT to take away some of the pain of rendering the HTML but then again it would be a new thing to learn. Probably in the long run it would be good but now I am trying to put my project back in schedule. Let's see what this saturday (being in office) brings in for me.
Don't realy know much about JSON. Probably would explore it in my spare time. [ April 13, 2007: Message edited by: Anupam Sinha ]