The first one isn't rendering for me, but i do see the pie chart. I'm
not familiar with the sparklines plugin so I can't see what the
problem is.

You could try something like:

$(document).ready(function(){
        $('.new_pie').click(function() {
                $('#orange').load('newcontent.html', function()
                        {
                                $('#orange .sparklines').sparkline('html', { 
type:'pie', height:
'1.0em', sliceColors: ['#bd0f10', '#e2e4e3']});
                        });
                
                return false;
        });
});

On Wed, Dec 10, 2008 at 10:05 AM, slandry <[EMAIL PROTECTED]> wrote:
>
> Brian thanks for the feedback. I'm definitely trying to render the
> sparklines on the HTML which is called by newcontent.html. In my
> example when you click the "link" you should see a pie chart. Instead
> you see the data "10,90"
>
> Here is a link to the code. I've slimmed every thing down to just this
> example:
>
> http://www.seanlandry.com/sparklines/
>
>
>
>
> It seems to me there needs to be some call that tells the sparklines
> function to fire again after the content has been loaded.
>
> On Dec 9, 7:11 pm, brian <[EMAIL PROTECTED]> wrote:
>> It depends on what's inside newcontent.html and what you want to do
>> with it. What liveQuery does, more or less, is keep track of any new
>> elements that match selectors for things added to its "queue" and
>> update them on the fly. For example, if you were planning to add new
>> links with class, "new_pie" you'd do this:
>>
>> $(document).ready(function(){
>>           $('.new_pie').liveQuery('click, function(event) {
>>                 $('#orange').load('newcontent.html')
>>                 return false;
>>        });
>>
>> });
>>
>> But it's something inside new_content.html that you're concered with.
>> Without seeing an example I can't really suggest anything except this
>> rough example:
>>
>> $(document).ready(function(){
>>           $('#orange #some_selector').liveQuery('click, function(event) {
>>                 doSomething();
>>                 return false;
>>        });
>>
>> });
>>
>> AFAIK, '#orange #some_selector' doesn't need to resolve to anything at
>> the time liveQuery is called.
>>
>> On Tue, Dec 9, 2008 at 10:29 AM,slandry<[EMAIL PROTECTED]> wrote:
>>
>> > I'm trying to load new contnet using the .load function in JQuery
>> > which works fine but the new content isn't being update with some
>> > javascript which should re-render the HTML into an image (sparklines)
>>
>> >    $(document).ready(function(){
>> >                $('.new_pie').click(function() {
>> >                        $('#orange').load('newcontent.html')
>> >            return false;
>> >        });
>> > });
>>
>> > Here is a link to the problem
>> > URL:
>> >http://seanlandry.com/sparklines/
>>
>> > Some user groups have suggested using LiveQuery, which I've loaded
>> > into the directory as well. But for the life of me I can't figure out
>> > how to use it to bind the events. Any suggestions?
>>
>> > Thanks!

Reply via email to