Skip to content

Script() Error #93

@ajmendez

Description

@ajmendez

I would like to add a <script></script> tag with some dynamic code to incorporate another module that was already created. Here is some sample code that reproduces this bug:

import dash
import dash_html_components as html

app = dash.Dash()

app.layout = html.Div([
    html.Script('alert(1);', type='text/javascript')
])

if __name__ == '__main__':
    app.run_server()

Loading this page in Chrome does not bring up an alert dialog as expected. Running alert(1); from the console does bring up an alert so it is not related to any adblocker. I tried adding async=True and defer=True, but the code does not seem to run.

dash.version
'0.17.7'
dcc.version
'0.6.0'
html.version
'0.7.0'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions