网页显示很奇怪...
这个是1.html的内容:
<html>
<head>
<title>Hello</title>
<script>
function show_text(id, text){
document.getElementById(id).innerHTML = text;
}
function show_color(id, color){
document.getElementById(id).style.color = color;
}
</script>
<style>
#ll {width: 200px; font-size:40px;}
</style>
</head>
<body>
<label id="ll">test</label>
<div>
<a href="javascript:void(0);" onclick='javascript:show_text("ll", "My First JavaScript");'>My First JavaScript</a><br>
<a href="javascript:void(0);" onclick='javascript:show_text("ll", "Hello python")'>Hello python</a><br>
<a href="javascript:void(0);" onclick='javascript:show_color("ll", "#f00")'>red</a><br>
<a href="javascript:void(0);" onclick='javascript:show_color("ll", "#0f0")'>green</a><br>
</div>
</body>
</html>
import web
urls = (
'/(.*)', 'hello'
)
app = web.application(urls, globals())
class hello:
def GET(self, name):
return open(r'1.html', 'r').read()
if __name__ == "__main__":
app.run()
这个是hello.py的内容:
import web
urls = (
'/(.*)', 'hello'
)
app = web.application(urls, globals())
class hello:
def GET(self, name):
return open(r'1.html' , 'r').read()
if __name__ == "__main__":
app.run()
然后输入http://127.0.0.1:8080 访问的时候,就是这样的...
刚开始学习,求大神指点