37,719
社区成员
发帖
与我相关
我的任务
分享
import web
urls = (
'/(.*)', 'index'
)
render = web.template.render('templates/')
class index:
def GET(self, name):
return render.jquerytest(name)
return
return render.test(name)
if __name__ == "__main__":
app = web.application(urls, globals())
app.run()
$def with(name)
<html>
<head>
<script type="text/javascript" src="./scripts/jquery.js"></script>
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery("button").click(function(){
jQuery("p").html("W3School");
});
});
</script>
</head>
<body>
<h2>This is a heading</h2>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
<button type="button">请点击这里</button>
</body>
$def with(name)
删除掉,直接打开该模板文件"jquerytest.html",网页打开正常,点按钮也正常工作