Sage Cell Embedding
-
Hi,
I’m having trouble getting an embedded cell on my web page.I’m using the
“CSS & Javascript Toolbox”
and this is the code.<!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <script src="http://sagecell.sagemath.org/static/jquery.min.js"></script> <script src="http://sagecell.sagemath.org/embedded_sagecell.js"></script> <script>$(function () { // Make the div with id 'mycell' a Sage cell sagecell.makeSagecell({inputLocation: '#mycell', template: sagecell.templates.minimal, evalButtonText: 'Activate'}); // Make *any* div with class 'compute' a Sage cell sagecell.makeSagecell({inputLocation: 'div.compute', evalButtonText: 'Evaluate'}); }); </script> <link rel="stylesheet" type="text/css" href="https://sagecell.sagemath.org/static/sagecell_embed.css"> </head> <body> <h2>Factorial</h2> Click the “Activate” button below to calculate factorials. <div id="mycell"> <script type="text/x-sage"> @interact def _(a=(1, 10)): print factorial(a) </script> </div> </body> </html>This runs in an html viewer, but I don’t understand why it doesn’t in the code snippet.
The following are some resources I’ve been using:
1
2
3
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Sage Cell Embedding’ is closed to new replies.