Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
learn_webpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dorothee Hueser
learn_webpy
Commits
e5525726
Commit
e5525726
authored
4 years ago
by
Dorothee Hueser
Browse files
Options
Downloads
Patches
Plain Diff
python variable to javascript - prepare rptb
parent
9b42c37d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
templates/tstjs.html
+8
-0
8 additions, 0 deletions
templates/tstjs.html
webpywithjs.py
+22
-0
22 additions, 0 deletions
webpywithjs.py
with
30 additions
and
0 deletions
templates/tstjs.html
0 → 100644
+
8
−
0
View file @
e5525726
$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>
This diff is collapsed.
Click to expand it.
webpywithjs.py
0 → 100644
+
22
−
0
View file @
e5525726
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
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment