sparkline and jquery-2.1.1.min.js

691 views
Skip to first unread message

David Edmister

unread,
Dec 1, 2014, 10:47:39 PM12/1/14
to jquery-s...@googlegroups.com
In the demo's i can get sparkline to work with jquery-1.7.1 but not with  jquery-2.1.1.min.js.  any reason for this?  do i have the wrong version of sparkline?

Javascript errors with 2.1.1 are 
jquery.sparkline.js:2499  Uncaught TypeError: Cannot read property 'msie' of undefined
jquery.sparkline.js:596 Uncaught TypeError: Cannot read property 'hasCanvas' of undefined

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 
<head>
  <script type="text/javascript" src="js/jquery-2.1.1.min.js"></script>
    <!--<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>-->
    <script type="text/javascript" src="js/jquery.sparkline.js"></script>
</head>
<body>

<p>
Inline Sparkline: <span class="inlinesparkline">1,4,4,7,5,9,10</span>.
</p>
<p>
Sparkline with dynamic data: <span class="dynamicsparkline">Loading..</span>
</p>
<p>
Bar chart with dynamic data: <span class="dynamicbar">Loading..</span>
</p>
<p>
Bar chart with inline data: <span class="inlinebar">1,3,4,5,3,5</span>
</p>
    <script type="text/javascript">
   $(document).ready(function () {
  //your code here
        /** This code runs when everything has been loaded on the page */
        /* Inline sparklines take their values from the contents of the tag */
        $('.inlinesparkline').sparkline(); 

        /* Sparklines can also take their values from the first argument 
        passed to the sparkline() function */
        var myvalues = [10,8,5,7,4,4,1];
        $('.dynamicsparkline').sparkline(myvalues);

        /* The second argument gives options such as chart type */
        $('.dynamicbar').sparkline(myvalues, {type: 'bar', barColor: 'green'} );

        /* Use 'html' instead of an array of values to pass options 
        to a sparkline with data in the tag */
        $('.inlinebar').sparkline('html', {type: 'bar', barColor: 'red'} );
    });
    </script>
</body>
</html>

Scott Carpenter

unread,
Mar 29, 2017, 3:34:43 PM3/29/17
to jQuery Sparkline
sounds like another plugin you might be using is calling $.browser

I had this issue because I had an old version of jquery UI (1.8 I think) once I replaced that file it cleared up the msie error 
Reply all
Reply to author
Forward
0 new messages