刚搞的ECS服务器,用web.py从服务器返回来的html文件,ie和edge可以正常解析,显示网页,但是chrome和手机上不渲染,仅仅展示html文件源码,求教啊~
<!DOCTYPE HTML>
<html>
<head>
<!-- META TAGS -->
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- STYLES -->
<link href="css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href="css/fullpage.css" rel="stylesheet" type="text/css">
<link href="css/style.css" rel="stylesheet" type="text/css">
<link href="css/custom.css" rel="stylesheet" type="text/css">
<!-- SITE TITLE -->
<title>Merry Christmas!</title>
</head>
<body>
<!-- AUDIO PLAYER -->
<audio class="audio-player" autoplay loop>
<source src="audio/song.mp3" type="audio/mpeg">
</audio>
<!-- BACKGROUND CONTAINER -->
<div class="bg-container snowy">
<!-- GLASS BALL -->
<div class="glass-ball rotate"></div>
<!-- TOP LIGHT -->
<div class="top-light"></div>
<!-- PAGE CONTENT -->
<div class="page-content">
<div class="fullpage">
<!-- HOME SECTION -->
<div id="home" class="section active">
<!-- TITLE -->
<h1 class="snow-text">Merry Christmas!</h1>
</div>
</div>
</div>
</div>
<!-- SCRIPTS -->
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/countdown.min.js"></script>
<script type="text/javascript" src="js/jquery.fullpage.min.js"></script>
<script type="text/javascript" src="js/three.canvas.js"></script>
<script type="text/javascript" src="js/snowy.js"></script>
<script type="text/javascript" src="js/script.js"></script>
<script type="text/javascript" src="js/custom.js"></script>
</body>
</html>
- jmpews
您好, 可以查看 web.py 返回 http header 里的内容类型是否为 html.
- 姬神
看返回的http headers里面的
content-type
,应该是设置得不对 - 吴楠.
你web.py中需要设置下response的Header中类型为html,否则默认当做text.
加个text/html的头