richpixel Posted December 3, 2013 Share Posted December 3, 2013 Well I know getting things to work on older versions of IE are not the highest priority... however- I chose pixi for some client work and of course they are having problems seeing it on IE9/Windows 7 I believe the problem is due to pixi using Object.defineProperty() which IE9 should be able to handle... but doesn't always. There's a lot out there about getting the browser into IE9 standards mode (or something) - but every combination of tags and doctypes I use only seem to fix the problem, only to have it broken the next time we open the browser. Using F12 developer tools to change the browser mode can fix it, but of course the end user won't be expected to do that. The start of my html looks like this: <!DOCTYPE html><html><head> <title>My Project</title> <meta http-equiv="X-UA-Compatible" content="IE=Edge"> <meta charset="utf-8"> Tried removing the IE=Edge meta tag but it gives me 'random' success. I'm basically ready to give up and convert to EaselJS which won't take me too long, but I'm still curious about this. Thanks for any clues! Quote Link to comment Share on other sites More sharing options...
xerver Posted December 4, 2013 Share Posted December 4, 2013 Have you tried just using a defineProperty polyfill? Quote Link to comment Share on other sites More sharing options...
Akis Posted December 4, 2013 Share Posted December 4, 2013 I don't use the IE=Edge thing and I have no issue with IE9...But still, I patched modified Pixi to not use Object.defineProperty so it might be the reason ^^ I never tried it with it before that, but as xerver said, you can try to use a polyfill if you're sure that's the reason of your problems. Quote Link to comment Share on other sites More sharing options...
richpixel Posted December 4, 2013 Author Share Posted December 4, 2013 Thanks xerver & Akis, this helps a lot. But I'm sort of new to Javascript and I don't really know what a polyfill for Object.defineProperty would look like... However I can certainly go through and create explicit get/set functions for the properties in question. Quote Link to comment Share on other sites More sharing options...
xerver Posted December 4, 2013 Share Posted December 4, 2013 You can just google for "Object.defineProperty polyfill" and you can find things like this: https://github.com/inexorabletash/polyfill/blob/master/es5.js#L73 That should be good enough; though you may want to grab Object.create out of there as well. Quote Link to comment Share on other sites More sharing options...
rich Posted December 4, 2013 Share Posted December 4, 2013 Object.defineProperty works fine in IE9, I'd wager the issue is with your doctype forcing it to fall into an unsupported mode. If you are telling it to use IE=Edge then you're basically saying only support the latest version of IE. IE9 will see this and fall into Quirks mode. This should help explain further: http://msdn.microsoft.com/en-us/library/ie/jj676915(v=vs.85).aspx Quote Link to comment Share on other sites More sharing options...
richpixel Posted December 5, 2013 Author Share Posted December 5, 2013 Thanks for all the help- It actually turned out to be a really dumb thing that had me chasing my tail. I forgot to disable calls to console.log() which crashes the program in IE9 - but only if the console is not open! I took out the console calls and it works without any of the IE-Edge stuff. Thanks again. Quote Link to comment Share on other sites More sharing options...
rich Posted December 6, 2013 Share Posted December 6, 2013 Ah yes, that old chestnut! Here, this might help in the future (function() { var consoleDisabled = false; if (consoleDisabled) { window.console = undefined; } if (window.console === undefined) { window.console = { debug: function() { return true; }, info: function() { return false; }, warn: function() { return false; }, log: function() { return false; } } } debug = (function(args) { window.console.debug(args); }); info = (function(args) { window.console.info(args); }); warn = (function(args) { window.console.warn(args); }); log = (function(args) { window.console.log(args); });})(); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.