I've got a JIT Spacetree on my webpage, and IE doesn't like a few lines. If I open the developer tools, and tell it to run through them, it looks great and loads everything as it should.
Is there any way I can get it to just say "You know what, these errors aren't really deal breakers, let's keep on going here"? The two further indented lines are the offenders, as well as something in jQuery 1.6.4 (will be trying 1.7.1) with either $.getJSON or $.parseJSON
var style = label.style;
style.width = node.data.offsetWidth;
style.height = node.data.offsetHeight;
style.cursor = 'pointer';
style.color = '#fff';
style.fontSize = '0.8em';
style.textAlign= 'center';
},
wrap the offending code in a try/catch, and don't do anything in the catch.
IE is "allergic" in defining an object and leave a comma at the last attribute.
Bad:
var apple = { color : "yellow",
taste : "good", };
Good:
var apple = { color : "yellow",
taste : "good" };
You could use a try catch statement.
var style = label.style;
try
{
style.width = node.data.offsetWidth;
style.height = node.data.offsetHeight;
}
catch(err) { /* do nothing */ }
style.cursor = 'pointer';
style.color = '#fff';
style.fontSize = '0.8em';
style.textAlign= 'center';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With