Thanks by your reply, I trying, but yet not work.

$(function () {
    // Make the div with id 'mycell' a Sage cell
    sagecell.makeSagecell({inputLocation: 'div.compute',
                           linked: true,
                           evalButtonText: 'Evaluate'});
});
    </script>


 <div class="compute">
<script type="text/x-sage">
def Hola():
    print "Hola"
</script>
</div>

<div class="compute">
<script type="text/x-sage">
Hola()
</script>
</div>


2013/4/19 Jason Grout <jason-s...@creativetrax.com>

> On 4/18/13 11:33 PM, Juan Grados wrote:
>
>> Dears members,
>>
>> I like use the SAGE to embed any code (example below). But I want linked
>> two cells using this
>> <https://github.com/sagemath/**sagecell/blob/master/doc/**
>> embedding.rst#linked-cells<https://github.com/sagemath/sagecell/blob/master/doc/embedding.rst#linked-cells>>
>> instruction
>>
>> but this not work. How I will be able to fix this?.
>> For example I trying call from "compute" cell the function Hola() in the
>> cell "mycell".
>>
>> <script>
>> $(function () {
>>      // Make the div with id 'mycell' a Sage cell
>>      sagecell.makeSagecell({**inputLocation: '#mycell',
>>                             evalButtonText: 'Evaluate'});
>>
>
> This makes the cell with id mycell a sage cell, which will have a
> different session from any other sage cells.
>
>
>
>       // Make *any* div with class 'compute' a Sage cell
>>      sagecell.makeSagecell({**inputLocation: 'div.compute',
>>                             linked: true,
>>                             evalButtonText: 'Evaluate'});
>>
>
> this makes any cell that is a div with class compute into a sage cell, and
> all of them (and none others) will be linked into one session.
>
>
>
>  });
>> </script>
>> <div id="mycell">
>>
>
> To get what you want, change this cell to have class="compute".  You can
> delete the first makeSagecell above as well.
>
>
>  <script type="text/x-sage">
>> def Hola():
>>      print "Hola"
>> </script>
>> </div>
>> <div class="compute"><script type="text/x-sage">
>> Hola()
>> </script>
>> </div>
>>
>
> Thanks,
>
> Jason
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to 
> sage-support+unsubscribe@**googlegroups.com<sage-support%2bunsubscr...@googlegroups.com>
> .
> To post to this group, send email to sage-support@googlegroups.com.
> Visit this group at 
> http://groups.google.com/**group/sage-support?hl=en<http://groups.google.com/group/sage-support?hl=en>
> .
> For more options, visit 
> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
> .
>
>
>


-- 
---------------------------------------------------------------------
MSc. Juan del Carmen Grados Vásquez
Laboratório Nacional de Computação Científica
Tel: +55 24 2233-6260
(http://www.lncc.br/)
http://juaninf.blogspot.com
---------------------------------------------------------------------

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to