Validating content of Ajax generated pages, request for feed

Post here if your message doesn't fit into another forum but is still about web development. Includes site critiques, web hosting and server questions, helpful software and resources, and more.
Post Reply
User avatar
MikeGale
Rank VI - Professional
Rank VI - Professional
Posts: 709
Joined: Mon Dec 13, 2004 1:50 pm
Location: Tannhauser Gate

Validating content of Ajax generated pages, request for feed

Post by MikeGale » Wed Apr 15, 2009 6:52 pm

With Ajax pages it is likely that most content is not present in the original source.

Instead of that content evolves as users complete data entry.

Content like drop down lists (selects), validation messages and page content is generated by both browser side code and on the server.

A page might have twelve different major states and a lot more if you consider all the permutations.

Validating the markup on such pages is an interesting issue. Some is literally in the source, some is entered verbatim from javascript, some is programmatically created by javascript...

During page life the content is no longer present as raw markup but is in a DOM, which can be turned into something like source (but will be quirky in some cases!).

Checking this markup is harder. You can inspect it within browser tools (those that give you a way to inspect and navigate the live DOM) but, as far as I know, there's no no-brainer way to validate each stage, on all browsers.

The solution that comes to mind is to introduce a method in a web service that accepts a serialisation of the DOM (DOM turned back into something looking like source markup) and creates files from it. Those files can then be checked automatically.

Before launching into that I would appreciate feedback from others who have done this or seen it done.

Post Reply