<div>Can you please elaborate further on the potential security risks.</div><div>I thought that code cells are not executed when opening an ipynb file.  It would have to be a little different than python CodeCells because the output of javascript cells could not really be stored in the ipynb, but we could still require each codecell to be manually executed by the user before being eval'd in the browser.</div>
<div><br></div><div>Have you seen jsFiddle?  My suggestion is sort of a mashup of iPython notebook and jsFiddle.</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div class="gmail_extra"><br>
<br><div class="gmail_quote">On Tue, Dec 18, 2012 at 1:40 PM, Matthias BUSSONNIER <span dir="ltr"><<a href="mailto:bussonniermatthias@gmail.com" target="_blank">bussonniermatthias@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi again,<br>
<br>
I'll moderate what I said an hour ago,<br>
I might see one way to maybe do something close to what you wish,<br>
It might not be strait forward, and I will thing about it.<br>
It might be incorporated in the JS widget we planed on implementing, I'll discusses of that with Brian<br>
to better now what his plans are.<br>
<br>
In any way it will probably change the notebook format introducing incompatibilities with older one, so<br>
we will think about it a lot before releasing it.<br>
<br>
We would still be happy to see what a prototype does, maybe you'll find how to do that in a way that<br>
prevent javascript injection at load time when exchanging ipynb files.<br>
<span class="HOEnZb"><font color="#888888">--<br>
Matthias<br>
</font></span><div class="im HOEnZb"><br>
Le 18 déc. 2012 à 14:02, Nissim Karpenstein a écrit :<br>
<br>
</div><div class="HOEnZb"><div class="h5">> Hi,<br>
><br>
> I'm new here and I wanted to run this by the group before I start working on it.  I'm interested in building a facility to use the notebook to edit and execute javascript code for presenting data from the python kernel.  I know there is a magic function and there is some sort of way to have python code render js in <script> tags, and you can put javascript in the Markdown cells, but I was envisioning something more like a standard codecell, but execution is handled by the browser rather than the kernel.<br>

><br>
> Let's say you've loaded some data and run some computations in your python kernel and now you want to display results in the notebook using some javascript library like d3, datatables or processing.  If you want to do this by writing the javascript code in a CodeCell and evaluating that code in the browser you need a couple of things:<br>

> 1) ability to change a code cell language to javascipt in the notebook frontend.  I saw that there is a language field in the notebook file format for CodeCell but it is always = python.<br>
><br>
> 2) facility to have the browser javascript engine evaluate the contents of the javascript CodeCell when it is executed by the user<br>
><br>
> 3) http REST api that will return json representations of Python objects that exist in the kernel.  (this may already exist, I don't really understand the kernel communication protocol yet).<br>
><br>
> There are probably some more things like the ability to add CSS, HTML, js and image resources to the server that it can then serve back to the client.  I see that there's been a lot of discussion related to this in the plugins thread, but maybe there can also be a method for accessing resources from the network and then telling the notebook server to serve them from some path.<br>

> I'd like to implement this and I had a couple of questions:<br>
><br>
> 1) Does this fit in with your ideas for the notebook or is editing non python code in CodeCell outside of the vision?<br>
><br>
> 2) Should there be another Dropdown for the language of the CodeCell or should there be a javascript option added to the existing select box.<br>
><br>
> Thanks<br>
><br>
>    -Nissim<br>
><br>
</div></div><div class="HOEnZb"><div class="h5">> _______________________________________________<br>
> IPython-dev mailing list<br>
> <a href="mailto:IPython-dev@scipy.org">IPython-dev@scipy.org</a><br>
> <a href="http://mail.scipy.org/mailman/listinfo/ipython-dev" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-dev</a><br>
<br>
_______________________________________________<br>
IPython-dev mailing list<br>
<a href="mailto:IPython-dev@scipy.org">IPython-dev@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/ipython-dev" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-dev</a><br>
</div></div></blockquote></div><br></div>