Collect values from put_html() #464
Unanswered
MinaGithuub
asked this question in
Q&A
Replies: 2 comments
-
Refer to #273 from pywebio.output import *
from pywebio.io_ctrl import output_register_callback
def click_callback(val):
put_text(val)
def main():
callback_id = output_register_callback(click_callback)
put_html("""
<button onclick="send_data()">Click me</button>
<script>
function send_data(){
WebIO.pushData('data', %r)
}
</script>
"""%callback_id)
start_server(main, port=8080, debug=True) |
Beta Was this translation helpful? Give feedback.
0 replies
-
太及时了,正为这个实现烦恼,感谢 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
If I am using html with JavaScript code in put_html, how to get values from the code that is inside put_html so that I can decide using the needed pywebio inputs or pywebio outputs further ?
Beta Was this translation helpful? Give feedback.
All reactions