Because HTML Inspector runs after the browser has parsed your HTML, any mistakes the browser has forgiven will not be seen by HTML Inspector.Īs a result HTML Inspector should not be seen as a replacement for validation. This makes it a lot more powerful, but there are some drawbacks as well. Validators parse static markup, while HTML Inspector runs on a live DOM. ![]() HTML Inspector is different than a markup validator. The following is a more in-depth explanation of each rule: Validation Here are the default configuration values: The function is passed an array of errors that were reported by individual rules. onComplete: (Function) the callback to be invoked when the inspection is finished.excludeSubTrees: (selector | element | Array) the descendants of any DOM element that matches the selector, element, or list of selectors/elements will be excluded from traversal.excludeElements: (selector | element | Array) any DOM element that matches the selector, element, or list of selectors/elements will be excluded from traversal (note: its descendants will still be traversed).If useRules and excludeRules are both set, the excluded rules are removed from the list of rules to use. excludeRules: (Array) a list of rule names not to run when inspecting.Defaults to running all rules not excluded via excludeRules ![]() useRules: (Array) a list of rule names to run when inspecting.domRoot: (selector | element) the DOM element to start traversing from. ![]() The inspect method takes a config object to allow you to change any of this behavior. Configuring HTML Inspectorīy default, HTML Inspector runs all added rules, starts traversing from the element, and logs errors to the console when complete, but all of this can be customized. Make sure you call inspect after any other DOM-altering scripts have finished running or those alterations won't get inspected. After the script runs, any errors will be reported to the console (unless you change this behavior).
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |