In Firefox, getting error in console "XML Parsing Error: mismatched tag" for input - html

I am getting the following error when opening up my page in Firefox (other browsers don't show this error). I am using HTML5 and if I try to put closing tags on the input, then the page fails validation.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge" >
<!--... more here...-->
</head>
<body>
<!--... more here...-->
<input type="text" id="wall_color_picker" onclick="startColorPicker(this)" title="Wall Color" value="#FFFFFF">
<!--... more here...-->
</body>
</html>
Edit 1: Firefox version is latest (59.0.2 (64-bit))
Edit 2: Response headers:
Cache-Control max-age=604800, public
Connection Keep-Alive
Content-Type text/html; charset=UTF-8
Date Tue, 24 Apr 2018 16:04:19 GMT
Keep-Alive timeout=5, max=100
Server Apache/2.4.6 (Red Hat Enterpri…penSSL/1.0.2k-fips PHP/5.6.35
Strict-Transport-Security max-age=31536000; includeSubdomains;
Transfer-Encoding chunked
X-Powered-By PHP/5.6.35

Because your <input>has no content allot of times people do not close the tag <input></input> but in your case close it at the end of it like so <input type="text" id="wall_color_picker" onclick="startColorPicker(this)" title="Wall Color" value="#FFFFFF"/>
Please try the following,
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge" >
<!--... more here...-->
</head>
<body>
<!--... more here...-->
<input type="text" id="wall_color_picker" onclick="startColorPicker(this)" title="Wall Color" value="#FFFFFF"/>
<!--... more here...-->
</body>
</html>
Hope this helps

It seems the Firefox version issue. I have tried that code snippet in Firefox 43.0.1 and found OK. You can please update the Firefox version.

TL;DR Your browser is reading your html in an older format
EDIT:
I'd like you to try two more things
In Firefox, select View Page Info from the context menu, and look for Render Mode.
Update to Firefox beta 60 Help -> About Firefox -> Update
It would seem that your browser is reading your code in the XHTML format which requires strict tags among other things. Ensure that your firefox is up to date, and also replace this line:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
with this:
<meta charset="utf-8">
Reason:
This is another element that’s been simplified since XHTML and HTML4, and is an optional feature, but recommended. In the past, you may have written it like this

Related

Meta Tag in HTML Mail is partly shown

We have vom .txt dokuments with our email content as HTML code.
Problem is, that we had to add some blank lines so the meta tag is not shown in the mails.
Until now, we had 5 blank lines, but with the Greek mails we need around 20 blank lines for this.
Is there a less ugly solution for this problem?
The affected meta tag:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
The Code in the Document:
Subject:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0," />
<style type="text/css">
//some css
</style>
</head>
//followed by body
Example in Mail:
-equiv="Content-Type" content="text/html; charset=utf-8">
The Mail is displayed as coded after this line.
Can someone please help?
Thank you!
Your message should not display as HTML at all. We can only surmise that adding empty lines somehow exposes a bug in some webmail clients. You should not be relying on this; you should send valid messages. Here is a simple minimal example of a valid HTML email message.
From: you <your.address#example.com>
To: recipient <their.address#example.net>
Subject: whatever you like
Mime-Version: 1.0
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: 8bit
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0," />
<style type="text/css">
//some css
</style>
</head>
//followed by body
I don't think the http-equiv is even necessary any longer, given that the MIME content declaration already sets things up for properly displaying it, but YMMV.
The Content-Transfer-Encoding: 8bit means lines have to be shorter than some 1,000 characters. If that's a problem, maybe employ a different content-transfer-encoding (quoted-printable, perhaps; but then you have to program that, too).

HTML Email - Not rendering correctly for Old Email Clients

I have at the start of the HTML Template:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org
/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=300, initial-scale=1.0, target-densitydpi=device-dpi">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="format-detection" content="telephone=no" /> <!-- disable auto telephone linking in iOS -->
<head>....
However, when it comes to old email clients, my HTML doesnt render at all, and is blank... I have tested this on litmus.
Is there something that I need to add or remove from above so that it also renders in the old browsers as well.
Thanks
Your meta tags should be inside the <head>.
What you have there otherwise looks fine, so it may have something to do with the rest of your document. I would recommend starting with Sean Powell's email boilerplate and bringing some of your code over.
Failing that, have you forgotten to close any elements such as tables/rows/cells?
Which email clients is it broken in?

What HTML version is this html

What html version is code snippet below?
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="Generator" content="some info here ..." />
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
Lets go line by line
<!DOCTYPE html> - HTML5 Doctype
<html xmlns="http://www.w3.org/1999/xhtml"> - Refer here
<head> - Document head element
<meta name="Generator" content="some info here ..." /> Description of the program you used to create the HTML document
<meta charset="utf-8" /> - Document Character Encoding, Good read
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> Read Here And Here
I would've certainly wrote a big fat description for each but realized that these were already asked in different questions, so thought to link them instead of repeating the same thing here again.
The code snippet is mostly the start of an HTML5 document in XHTML (XML) serialization, sometimes confusingly called XHTML5.
It is not a conforming document, however; the current HTML5 CR does not allow the attribute http-equiv="X-UA-Compatible" (on rather formal grounds, but still).
The doctype belongs to HTML5 Doctype definition.
So the rest of the document should be bases on HTML5

Setting HTML meta elements with knitr

I'm generating HTML reports using knitr, and I'd like to include author and generation date meta tags.
My Rhtml page looks something like this.
<html>
<head>
<meta name="author" content="<!--rinline Sys.getenv('USERNAME') -->">
<meta name="date" content="<!--rinline as.character(Sys.time()) -->">
</head>
<body>
</body>
</html>
Unfortunately, after I knit("test.Rhtml"), the HTML that knitr generates is
<meta name="author" content="<code class="knitr inline">RCotton</code>">
<meta name="date" content="<code class="knitr inline">2013-01-02 14:38:16</code>">
which isn't valid HTML. What I'd really like to generate is something like
<meta name="author" content="RCotton">
<meta name="date" content="2013-01-02 14:38:16">
Can I generate R code that doesn't get a code tag wrapping it? Or is there another way to specify tag attributes (like these content attributes)?
So far my least-worst plan is to manually fix the content with readLines/str_replace/writeLines, but this seems rather kludgy.
Another (undocumented) approach is to add I() around your inline code to print the characters as is without the <code> tag, e.g.
<html>
<head>
<meta name="author" content="<!--rinline I(Sys.getenv('USERNAME')) -->">
<meta name="date" content="<!--rinline I(as.character(Sys.time())) -->">
</head>
<body>
</body>
</html>
Not really nice, but seems to work without adding a hook:
<head>
<!--begin.rcode results='asis', echo=FALSE
cat('
<meta name="author" content="', Sys.getenv('USERNAME'), '">
<meta name="date" content="', as.character(Sys.time()),'-->">
',sep="")
end.rcode-->
</head>

SyntaxError: Invalid character '\u0008' message from the DOCTYPE tag

I am setting up a server and am getting a strange error I have never seen before:
It is complaining about line 1 in the source, but that is just the DOCTYPE tag!
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> -->
...
As you can see I already tried setting the Content-Type to be something other than utf-8. What is happening here?
The actual cause of the error is not located at line 1. For example, using eval also causes errors to be reported at line 1.
Look in your source code for the BACKSPACE U+0008 character. A method to spot this invisible character is described here.
What happens if you add an comment on line1?
<!--empty line for the fun of it-->
<!DOCTYPE HTML>