未声明框架文档的字符编码

时间:2017-06-08 10:06:31

标签: javascript html css

所以,我一直在寻找解决问题的方法,但我认为我已经尝试了所有方法,但我的代码根本没用。

我试图将一些txt文件的文本放在iframe中,并且实际上正在阅读它,但是,当我尝试更改css时,会在标题中显示消息:&# 34;未声明框架文档的字符编码。"

这是我的代码:

    <!DOCTYPE  html>
<html lang = "pt">
<head>
    <meta content="text/html;charset=utf-8" http-equiv="Content-Type">
    <meta content="utf-8" http-equiv="encoding">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<style>
h1{
    position: absolute;
    left:85px;
    top:0px;
}
.LOGO{
    position: absolute;
    width:70px;
    height:70px;
    z-index: 2;
}
.portugal{
    position: absolute; 
    top: 65px; 
    left: 0px; 
    width:auto;
    height:auto;
    z-index: 1; 
}
.PT01{
    position: relative;
    top: 438px;
    left:560px;
    width:20px;
    height:20px;
    z-index: 3;
}

</style>
</head>
<body>
<script>
    var x = document.getElementsByTagName("PT01");
    if(x.id == 'PT01'){
        $("#div1").css("border-style","none");
        $("#div1").css("position",'relative');
        $("#div1").css("top",'315px');
        $("#div1").css("left",'535px');
        $("#div1").css("width",'auto');
        $("#div1").css("height",'auto');
        $("#div1").css("zIndex",'4');
    }

</script>

    <img class = "LOGO" src = "http://www.chronopost.pt/sites/all/themes/custom/quimera/favicon.ico"/> <h1> Informações Package Chronopost </h1>
    <img class = "portugal" src = "http://s2.thingpic.com/images/HV/9N2YRDXBuosfkppy9Jut8Tvx.png"/> 
    <img class = "PT01"  name = "PT01" src = "http://www.chronopost.pt/sites/all/themes/custom/quimera/favicon.ico"/>
    <iframe id='div1' src = "PT01.txt">
    </iframe>

</body>
</html>

我希望你能帮助我!我只是一名学生而且我正在努力学习更多知识。 谢谢!

1 个答案:

答案 0 :(得分:2)

可能重复here

您可以尝试此操作,在iframe标记之间添加:

<meta http-equiv="Content-type" content="text/html;charset=UTF-8">