Skip to content
Snippets Groups Projects
Commit e5525726 authored by Dorothee Hueser's avatar Dorothee Hueser
Browse files

python variable to javascript - prepare rptb

parent 9b42c37d
No related branches found
No related tags found
No related merge requests found
$def with (title, xfloatstr)
<h1 id="Ueberschrift"></h1>
<script>
var t = '${title}';
var xfloatstr = '${xfloatstr}';
var xfloat = parseFloat(xfloatstr) * 3;
document.getElementById('Ueberschrift').innerHTML = t + ' ' + xfloat;
</script>
import web
urls = (
'/', 'index',
'/tstjs', 'tstjs'
)
render = web.template.render('templates', base='base')
app = web.application(urls, globals())
class index:
def GET(self):
raise web.seeother('/tstjs')
class tstjs:
def GET(self):
title = "Moin moin"
xfloatstr = "0.8"
return render.tstjs(title, xfloatstr)
if __name__ == "__main__":
app.run()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment