tags:

views:

22

answers:

1

Hi,

I have developed a jquery plugin for facilitating Ajax requests.

For debugging purposes, I'd also like it to optinally check dynamically loaded html / xhtml code for well-formedness. Is there any easy to do that with jQuery?

Thanks,

Adrian

A: 

Have you attempted to append the HTML to the document and then inspecting it for some basic properties such as the existence of ids that occur in the HTML? This is a very simplistic way to determine if the HTML is well formed but I think it would work as the browser would reject malformed HTML for you.

Macy Abbey
This might work, but it looks like a very shaky approach. There is no guarantee what the browser might do (or not do) once I dynamically insert malformed HTML code.
Adrian Grigore