IT小汉
2016-11-23 22:14
你的demo素材文本可以上传一下么?
太感谢了
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()
<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> div p { color : #f00; } .py { font-size : 40px; } #1l { width : 200px; font-size : 40px; } </style> </head> <body> <h1>hello</h1> <div>World</div> <p class='py'>python</p> <label id='1l'>test</label> <div> <a href="javascript:void(0);" onclick='javascript:show_text("1l", "My First Javascript");'>My First Javascript</a> <a href="javascript:void(0);" onclick='javascript:show_text("1l", "Hello Python");'>Hello Python</a> <a href="javascript:void(0);" onclick='javascript:show_color("1l", "#f00");'>Red</a> <a href="javascript:void(0);" onclick='javascript:show_color("1l", "#0f0");'>Green</a> </div> </body> </html>
python-web.py开发入门
58639 学习 · 106 问题
相似问题