memex-in's picture
Update app.py
93f0388 verified
raw
history blame contribute delete
850 Bytes
import streamlit as st
from streamlit.components.v1 import html
# Define your javascript
my_js = """ alert("Hola mundo"); """
# Wrap the javascript as html code
my_html = f"""
<head>
<script>{my_js}</script>
<style>
.hi {{
border: 2px solid red;
padding: 10px;
border-radius: 25px;
}}
</style>
</head>
<body bgcolor="white">
<div class="hi">
Test
</div>
<script type="text/javascript">
atOptions = {{
'key' : 'aa6d8a1256bea03bbcd6b9a059c9585c',
'format' : 'iframe',
'height' : 60,
'width' : 468,
'params' : {{}}
}};
</script>
<script type="text/javascript" src="//incompetencesorting.com/aa6d8a1256bea03bbcd6b9a059c9585c/invoke.js"></script>
</body>
"""
# Execute your app
st.title("Javascript example")
st.components.v1.html(my_html, height=300) # Specify height for the HTML component