gwatts / jquery.sparkline

A plugin for the jQuery javascript library to generate small sparkline charts directly in the browser
http://omnipotent.net/jquery.sparkline/
1.24k stars 278 forks source link

Sparkline canvas is empty if page is loaded by AJAX #11

Closed tim-peterson closed 12 years ago

tim-peterson commented 12 years ago

Hi Gareth, thanks for such a great plugin. Its really easy to use!

My sparkline chart appears when I do a full page load but not if it is loaded by AJAX. What solves the problem is if also include the jQuery library in my AJAX page load. I'd rather not have to load jQuery as part of the AJAX request as that defeats the purpose of AJAX (cutting down on #/size of http requests).

This issue is not specific to my implementation of sparkline.js because cutting and pasting the demo code has the same problem.

I've tried many different kinds of script and html ordering but loading jQuery is the only thing that works.

I'm inexperienced with JavaScript/jQuery so I apologize if I'm not understanding something trivial. thoughts?

thanks, tim

gwatts commented 12 years ago

As per issue 6, a small demo of the problem would motivate a solution ;-)