Some time ago, Jupyter Notebooks began to remove JavaScript from HTML content [ # 3118 ]. Here are two solutions:
Local HTML Service
If you want to embed an HTML page with JavaScript on your page now, the easiest way is to save your HTML file in a directory with a notebook, and then load the HTML as follows:
from IPython.display import IFrame IFrame(src='./nice.html', width=700, height=600)
Remote HTML Service
If you prefer a hosting solution, you can upload your HTML page to the Amazon Web Services basket in S3, change the settings of this container to make the host host a static website, and then use the Iframe component in your notebook:
from IPython.display import IFrame IFrame(src='https://s3.amazonaws.com/duhaime/blog/visualizations/isolation-forests.html', width=700, height=600)
This will render your HTML content and JavaScript in an iframe, like on any other web page:
<iframe src='https://s3.amazonaws.com/duhaime/blog/visualizations/isolation-forests.html', width=700, height=600></iframe>
duhaime Sep 14 '18 at 19:28 2018-09-14 19:28
source share