[IPython-dev] How can an extension inject HTML?

MinRK benjaminrk at gmail.com
Thu May 23 19:08:10 EDT 2013


On Thu, May 23, 2013 at 4:04 PM, David Wolever <david at wolever.net> wrote:

>
> On 2013-05-23, at 6:42 PM, MinRK <benjaminrk at gmail.com> wrote:
>
> typically in your profile's custom.js, you can perform arbitrary
> manipulation of the notebook page.
>
>
> Hrm… This seems less than ideal, since it would mean that installing the
> BrowserCast extension requires the extra fiddly step of editing your
> custom.js.
>
> Is there no other way the extension can inject JavaScript?
>

you can always inject javascript from any Python code by calling
`display(Javascript("some_javascript();"))`.  It is often appropriate to
make such a call as part of `%load_ext browsercast`, for example.

But custom.js is the only way to add js that runs on all notebooks at load
time without executing any code.



>
>
>
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20130523/1ec3e89d/attachment.html>


More information about the IPython-dev mailing list