I get this warning in FF when developing a site of mine. I can't find any real info about it and how to fix this.
the character encoding of a framed document was not declared. The document may appear different if viewed without the document framing it.
...e)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f....
jquery....min.js (line 4)
You need to put
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
In the head of the iframe or whatever charset encoding you are using.
In your case, it looks like you are serving a javascript file. In order to set the character encoding, you have to set it in the Content-Type
HTTP header when serving the javascript file.
E.g:
Content-Type: application/javascript; charset=utf-8
However, if you are using an <iframe>
element to reference javascript, then you are doing it wrong.
You should only use an <iframe>
to display something, like HTML, text, SVG, PDF etc.
For an HTML document you can, inside the .html
file, set the character encoding with a charset
attribute on the <meta>
tag and on a <script>
tag. Note that the latter is deprecated and all modern browsers will read the <meta>
tag of the document referencing the script.
iframed.html
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<script src="jquery....min.js" charset="utf-8"></script>
<!-- note: setting charset on a <script> tag is deprecated -->
</head>
index.html
<body>
<iframe src="iframed.html">
</body>
If you have access to your web server, then you can set the character encoding as part of the response with Content-Type
and you do not need to specify it in your documents.
Content-Type: text/html; charset=utf-8
Content-Type: application/javascript; charset=utf-8
Content-Type: application/json; charset=utf-8
Content-Type: text/plain; charset=utf-8
In nodejs you use the setHeader
method on the Response
object.
response.setHeader ('Content-Type', 'text/html; charset=utf-8')
You can use your browser's DevTools to inspect the network request and check the value of Content-Type
header. See screen shot below.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With