Skip to content

Instantly share code, notes, and snippets.

@ellisonbg
Created March 6, 2014 23:28
Show Gist options
  • Save ellisonbg/9401925 to your computer and use it in GitHub Desktop.
Save ellisonbg/9401925 to your computer and use it in GitHub Desktop.
JavaScript/HTML Output
Display the source blob
Display the rendered blob
Raw
{
"metadata": {
"name": "",
"signature": "sha256:409323e2c629d861c4e510b92a10b63e0ae7453d1f2d56ce7c983d892e3ab519"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "code",
"collapsed": false,
"input": [
"%%html\n",
"\n",
"<h1>Hi there</h1>"
],
"language": "python",
"metadata": {},
"outputs": [
{
"html": [
"\n",
"<h1>Hi there</h1>"
],
"metadata": {},
"output_type": "display_data",
"text": [
"<IPython.core.display.HTML at 0x1041cd2d0>"
]
}
],
"prompt_number": 1
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%%javascript\n",
"alert('hi');"
],
"language": "python",
"metadata": {},
"outputs": [
{
"javascript": [
"alert('hi');"
],
"metadata": {},
"output_type": "display_data",
"text": [
"<IPython.core.display.Javascript at 0x1041c7f10>"
]
}
],
"prompt_number": 5
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%%html\n",
"\n",
"<div id=\"foo\">Hi there</div>\n",
"\n",
"<script>$('#foo').css('color', 'red');</script>"
],
"language": "python",
"metadata": {},
"outputs": [
{
"html": [
"\n",
"<div id=\"foo\">Hi there</div>\n",
"\n",
"<script>$('#foo').css('color', 'red');</script>"
],
"metadata": {},
"output_type": "display_data",
"text": [
"<IPython.core.display.HTML at 0x1041cda90>"
]
}
],
"prompt_number": 10
},
{
"cell_type": "code",
"collapsed": false,
"input": [],
"language": "python",
"metadata": {},
"outputs": []
}
],
"metadata": {}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment