Graceful fallback for unsupported browsers like IE9

190 views
Skip to first unread message

Jas

unread,
Sep 2, 2015, 10:52:44 AM9/2/15
to Google Web Designer beta
I'm incredibly happy with GWD, it makes creating CSS3 animations so easy especially if you have to tweak them or make changes (vs coding by hand). One thing I'm struggling with is Internet Explorer (particular 9 and lower). Nothing shows up in this browser (since animations are not supported). In addition, the JavaScript code in gwd_webcomponents_min.js seems to kill things when using classList.add, as well.  Is there a way to display a fallback image or alternative? What would someone do to have an alternative for situations where the code normally generated by GWD doesn't work in a particular browser? I don't see an option within the tool.

Thanks,
Jas

Jas

unread,
Sep 2, 2015, 11:35:32 AM9/2/15
to Google Web Designer beta
So I decided I might find code to add in the missing JavaScript features, at least to prevent the JS from failing.

I added a shim for classList
(can be found here: https://github.com/eligrey/classList.js/blob/master/classList.js) before any of the other scripts (just embedded the code right into the page from Code View) and this seem to solve the issue of the JS error thrown from gwd_webcomponents. There didn't seem to be any additional JS errors after that.

My background images seem to show up and the tap area is clickable so that's promising... perhaps some HTML conditionals now to display some alternate content...

Reply all
Reply to author
Forward
0 new messages