Hi All,
I use eval function in react.js to run the javascript and create a component.
I’m not sure if it’s safe to use, but it work.
Here is an example for opening url with window.open()
app.layout = html.Div([
html.Button('open url', id = 'button'),
visdcc.Run_js(id = 'javascript')
])
@app.callback(
Output('javascript', 'run'),
[Input('button', 'n_clicks')])
def myfun(x):
if x:
return "window.open('https://yahoo.com/')"
return ""