www.webdeveloper.com
Results 1 to 6 of 6

Thread: Validate markup of dynamically generated content

Hybrid View

  1. #1
    Join Date
    Apr 2010
    Posts
    4

    Validate markup of dynamically generated content

    I have tried every browser plugin that I could find. I am trying to validate an application. It uses ajax. There are many holder divs that are set with innerHTML. All attempts I have tried only validate the original markup and not the generated content. I purposely put invalid content into the divs dynamically and try to validate and it still validates. How can I validate the dynamic content? I can see that in chrome or with firebug that the content is viewable element by element. Is there a plugin that can look at the generated content and validate it?

  2. #2
    Join Date
    Mar 2010
    Posts
    2,803
    A potentially long winded way, depending on how many variations there are to your dynamic content, is to

    1) open your web page in a browser and then view its source.

    2) save the source in a html file

    3) upload the source to the w3c validator and validate it.

  3. #3
    Join Date
    Apr 2010
    Posts
    4
    Quote Originally Posted by tirna View Post
    A potentially long winded way, depending on how many variations there are to your dynamic content, is to

    1) open your web page in a browser and then view its source.

    2) save the source in a html file

    3) upload the source to the w3c validator and validate it.
    That would be fine if I could view the dynamic content. Viewing the source shows only the original static content. I found a chrome plugin that will allow me to show generated content. It closes unclosed tags before it displays so this will not help.

  4. #4
    Join Date
    Feb 2010
    Posts
    184
    Code:
    I found a chrome plugin that will allow me to show generated content. It closes unclosed tags before it displays so this will not help.
    Yep same problem with firefox firebug.

    I am looking for the same plugin.

    I guess you could always write a wrapper around .innerHTML e.g.

    Code:
    function setInnerHTML(element, html) {
      // save your html code to be used for validation
      element.innerHTML = html;
    }
    Last edited by letmehaveago; 07-13-2010 at 10:42 AM.

  5. #5
    Join Date
    Nov 2002
    Location
    Flint, Michigan, USA
    Posts
    590
    There is a Firefox plugin that should meet your needs. It does some basic validation and displays however much of the code you wish to see. It's called View Source Chart.

  6. #6
    Join Date
    Feb 2010
    Posts
    184
    Charts are based on the post-rendered source returned by the browser (source after the DOM has been altered by JavaScript, and quirks or standards mode).
    Does it show the code that is inserted into the dom? or the cleaned up code as suggested above from https://addons.mozilla.org/en-US/firefox/addon/655/

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles