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

replaceWithShape, replaceWithShapes throw when elements get removed from the DOM in IE7/8 #68

Open daniel-rothig opened 11 years ago

daniel-rothig commented 11 years ago

The lines that assign existing[0].outerHtml throw an exception when the DOM element gets removed in IE7 and IE8.

This is particularly and issue when user interactions cause the shape to be redrawn continuously, and when the set of elements get re-rendered regularly (eg. by using jQuery's render facility). Wrapping the lines containing existing[0].outerHtml in try-catch clauses restores the desired behaviour.

gwatts commented 11 years ago

Do you have a small jsfiddle.net example that demonstrates this issue?