-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathdemo.js
50 lines (48 loc) · 1.82 KB
/
demo.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
$(document).ready(function() {
var html = [
"<title></title>",
"<table><tbody></tbody><col></table>",
"<tag><img apple=\"no\" banana='yes'></img></tag>",
"<form action=''>",
" <fish></fish>",
" <fieldset>",
" <img>",
" <legend></legend>",
" <legend></legend>",
" <input>",
" <!--</html><!-- :D -->",
" </fieldset>",
"</form>",
"<table>",
" <col>",
" <tr>",
" <td>",
" </tbody>",
"</table>",
"<del><p>hallo</p></del>",
"</body>",
"<img>",
"<img>",
"<p><a></a></p>",
"<form><fieldset><input type checked disabled='blah'></fieldset></form>",
"</html>"
].join("\n");
$.htmlValidator.doctypes;
$.htmlValidator.doctype("HTML 4.01 Strict");
$.htmlValidator.parseSettings();
$.htmlValidator.parseSettings({});
$.htmlValidator.parseSettings({url: ""});
$.htmlValidator.parseSettings({html: html});
$.htmlValidator.parseSettings({fragment: $("div")});
$.htmlValidator.parse({doctype: "HTML 4.01 Frameset", html: html});
console.log($.htmlValidator.parse({doctype: "HTML 4.01 Transitional", html: html}).call($.htmlValidator.fn.draw));
console.log($.htmlValidator.validate({doctype: "HTML 4.01 Transitional", html: html}));
//$.htmlValidator.parse({doctype: "HTML 4.01 Transitional"}); //Parses current page by AJAX with GET
//$.htmlValidator.parse({doctype: "HTML 4.01 Transitional", type: 'post', data: {foo: 'bar'}); //Default loads current page by AJAX with POST
//$.htmlValidator.parse({doctype: validator.doctype("HTML 4.01 Transitional"), html: html});
//$.htmlValidator.validate();
//$.htmlValidator.validate({fragment: $("#section").html()});
//$.htmlValidator.validate({url: "/foo/bar"});
//$.htmlValidator.validate({formatted: true});
//$.htmlValidator.validate({formatted: false});
});