asp.net mvc 3 - Is it okay to include markup after the closing </html> tag? -
since closing html tag optional, okay include markup after closing </html>
tag?
an example of exists phil haack's routedebugger library. sample output looks this:
<!doctype html> <html> <head> <title>index</title> <link href="/content/site.css" rel="stylesheet" type="text/css" /> <script src="/scripts/jquery-1.4.4.min.js" type="text/javascript"></script> </head> <body> <h2>index</h2> </body> </html> <!-- content after closing html tag! --> <html> <div id="haackroutedebugger" style="background-color: #fff;"> <style> #haackroutedebugger, #haackroutedebugger td, #haackroutedebugger th {background-color: #fff; font-family: verdana, helvetica, san-serif; font-size: small;} #haackroutedebugger tr.header td, #haackroutedebugger tr.header th {background-color: #ffc;} </style> <hr style="width: 100%; border: solid 1px #000; margin:0; padding:0;" /> <h1 style="margin: 0; padding: 4px; border-bottom: solid 1px #bbb; padding-left: 10px; font-size: 1.2em; background-color: #ffc;">route debugger</h1> <div id="main" style="margin-top:0; padding-top:0"> <p style="font-size: .9em; padding-top:0"> type in url in address bar see defined routes match it. {*catchall} route added list of routes automatically in case none of routes match. </p> <p style="font-size: .9em;"> generate urls using routing, supply route values via query string. example: <code>http://localhost:14230/?id=123</code> </p> <p><label style="font-weight: bold; font-size: 1.1em;">matched route</label>: {controller}/{action}/{id}</p> <div style="float: left;"> <table border="1" cellpadding="3" cellspacing="0" width="300"> <caption style="font-weight: bold;">route data</caption> <tr class="header"><th>key</th><th>value</th></tr> <tr><td>controller</td><td>home </td></tr> <tr><td>action</td><td>index </td></tr> </table> </div> <div style="float: left; margin-left: 10px;"> <table border="1" cellpadding="3" cellspacing="0" width="300"> <caption style="font-weight: bold;">data tokens</caption> <tr class="header"><th>key</th><th>value</th></tr> </table> </div> <hr style="clear: both;" /> <table border="1" cellpadding="3" cellspacing="0"> <caption style="font-weight: bold;">all routes</caption> <tr class="header"> <th>matches current request</th> <th>url</th> <th>defaults</th> <th>constraints</th> <th>datatokens</th> </tr> <tr><td><span style="color: #c00">false</span></td><td>{resource}.axd/{*pathinfo}</td><td>(null)</td><td>(empty)</td><td>(null)</td></tr><tr><td><span style="color: #0c0">true</span></td><td>{controller}/{action}/{id}</td><td>controller = home, action = index, id = urlparameter.optional</td><td>(empty)</td><td>(empty)</td></tr><tr><td><span style="color: #0c0">true</span></td><td>{*catchall}</td><td>(null)</td><td>(null)</td><td>(null)</td></tr> </table> <hr /> <h3>current request info</h3> <p> apprelativecurrentexecutionfilepath portion of request routing acts on. </p> <p><strong>apprelativecurrentexecutionfilepath</strong>: ~/</p> </div> </div>
i notice appended markup begins <html>
tag. presence of tag somehow validate location of content?
no, it's not ok, browsers forgiving bad html.
try http://validator.w3.org/ see if document valid html or not (it isn't).
Comments
Post a Comment