code_junkie

Can I detect XHTML parsing errors using Javascript

Nov 13th, 2011
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. (function() {
  2. if(document.documentElement &&
  3. document.documentElement.getAttribute('xmlns') !==
  4. 'http://www.w3.org/1999/xhtml') {
  5. alert('parsing errors');
  6. }
  7. else if(document.body && document.body.lastChild) {
  8. alert('no parsing errors');
  9. }
  10. else setTimeout(arguments.callee, 100);
  11. })();
Add Comment
Please, Sign In to add comment