You can use the magic function %%javascriptto run javascript on an IPython laptop. For example, paste the following code into an IPython cell and run it. You should see the output in the javascript browser console.
%%javascript
console.log("Hello World!")
For global variables, you can add an attribute to the object windowsfor For example, in the cell, execute the following code:
%%javascript
window.myvar = 12;
javascript . .
%%javascript
console.log(myvar)
element , :
%%javascript
element.append(myvar)