Is it possible to use two head and two body tags on the same page?
I want to be able to upload a file and while the file is being transferred have something like a progress bar giving feedback to the user. When the server start to receive the file it will immediately开发者_StackOverflow start to output html and when the file has finished to upload the server starts to output the real page.
The thing is that I don't know what is going in the head until the file is uploaded. So my question is if I can use two html tags and two body tags without breaking the page, even if it's a really fugly solution, and what are the consequences.
<html>
<head>
...
</head>
<body>
...
</body>
<head>
...
</head>
<body>
...
</body>
</html>
No, you cannot. This doesn't w3-validate and the behaviour among browsers is unspecified and not guaranteed to be consistent.
I strongly recommend to show the result in an <iframe>
instead.
精彩评论