【发布时间】:2017-08-03 01:01:34
【问题描述】:
我在html中包含脚本(网页模板),当我通过http://127.0.0.1:8080/main访问它时它不起作用,但是在我本地双击html文件时,脚本可以工作。
我在这里找到一个问题,但答案也不起作用: including script doesn't work in web.py
# web.py
import web
urls = ('/main', 'main')
render = web.template.render('templates/')
class main:
def GET(self):
return render.main()
app = web.application(urls, globals())
if __name__ == "__main__":
app.run()
下面是 HTML
<!DOCTYPE html>
<html>
<head>
<title>title</title>
<script src="echarts.min.js"></script>
</head>
<body>
<p>Hello world!+++</p>
【问题讨论】:
-
"Doesn't work" 意思是……找不到js文件,或者文件加载了但没有执行,或者/main什么都没有返回……?
标签: javascript html web.py