lrsjng / jquery-fracs

jQuery plugin to determine the visible fractions of HTML elements.

Home Page:https://larsjung.de/jquery-fracs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No IE7 or IE8 support

dynamicdan opened this issue · comments

JS errors on page load.

ALSO, please document your known browser support.

Would love to use the project for a horizontal timeline project but no IE7+ support is a show stopper for me.

Hi,
what kind of error do you get?

As far as I can test it works fine in latest stable Chrome, Firefox and Opera. Safari and IE are not available for my system so I neither can test nor give a report for that browsers, sorry.

Would be useful to have bug reports for that browsers.. so feel free to send me anything you can come up with

Thanks
Lars

Hi Lars,

When I run fracs in IE8, I get the following error, reported from lines 217 & 327 of fracs-0.9.js:

'HTMLElement' is undefined

I've Googled briefly to learn that Internet Explorer fails to expose the HTMLElement constructor/prototype, so checking whether or not a given object is an instance thereof cannot be accomplished with the instanceof operator.

In both cases, I've simply reversed the logic of the conditional, and instead of checking if the variable is an instanceof HTMLElement, check if instanceof Rect. That seems to work for me.

I noticed you're also checking if canvas is instanceof HTMLElement (line 567), but I don't think canvas is supported in IE anyway... still might be worth taking a look at.

Cheers,
John

I debugged fracs in IE7/8 that got caught up with this line for me:

var $label = $( "<div class='label'><span class='idx'>#" + i + "</span></div>" ).appendTo( $section );

I just used the step debugger to work my way out of the default (useless) jquery reported error in IE. I'm not really in a position to support IE7/8 for you but I can definitely say that if you want more traction in the dev community, then you'll need to support at least IE8 (yes, I know it hurts). I suggest installing a virtual machine running windows 7 and IE9 (IE9 has options for testing in IE7 and 8).

Hey @dynamicdan, that error you've found is not from the fracs.js lib, it's from the demo script alone. I'm not entirely sure why that line is causing trouble, but either way it shouldn't have anything to do with fracs.

With the amend I mention above (inverting the conditional to not have to check for HTMLElement), I've successfully got fracs working for me on IE7/8. Granted I'm not using much of fracs, just what's in core.

I agree with you 100% though, IE7/8 support is vital for serious adoption. I think this is a great plugin, so I'd like to see it flourish...

Cheers,
John

Thanks to both of you @johndwells and @dynamicdan!

I will have a look at the conditionals and change that. If I remember right, then I had it the way you changed it in a previous version and changed it for some reason. I will check that.

As for the general IE support a virtual machine is no problem at all, but I don't have a win cd/license and won't spend money for one just for testing IE support, I hope you understand that.

Thanks for your feedback!
Lars

Let's keep the ball moving...

On the IE testing front: one can install a (free) virtual PC from microsoft that lasts like 10 hours or something but if you're on a VPC, then one can easily not save the state of the machine, thus having endless test time. MS provides these disk images for devs to test their different browsers and they require no activation keys.

I was also recently sent this that may be of interest for quick install and setup: https://github.com/xdissent/ievms

That a really great alternative. Coincidental I found this link today in my feeds...

http://www.webupd8.org/2011/09/test-websites-in-internet-explorer-9-8.html

Will give it a try now..

The upcoming release 0.11 will definitly work in all modern browsers and IE7+8. Since IEs < 9 don't support the canvas tag the outline feature will of course not be available in those browser.