dashing-js icon indicating copy to clipboard operation
dashing-js copied to clipboard

IE 10 Compatibility

Open liquiddc opened this issue 11 years ago • 4 comments

These changes make dashing-js work with IE10

liquiddc avatar Jan 29 '14 14:01 liquiddc

Thanks for this patch. I'll check it out, too. 2 comments though:

  • Is the Access-Control-Allow-Origin: * header really necessary for you? In my opinion the domain on which the client JS runs should always be the same as for the server itself. Why would we need cross-origin scripting?
  • Instead of commenting out console.log(...) I suggest to add a polyfill such as console-polyfill which can also be installed via bower. If we don't need a complete polyfill, a simple var console=console||{"log":function(){}}; should do the trick, too. The reason is that console.log actually is supported in IE10, but only if the console window is open.

arabold avatar Feb 15 '14 17:02 arabold

Thanks. Re the first point, I agree this needs tightening up, but * was the suggested fix that I found works in my environment. If there is a tighter way to specify this header, I will try it out.

Re the second point - creating a console object for IE in no-console mode is the way to go. I have no IE10 environment to test this in now, but adding the following line to application.coffee works in IE11:

console = console or {"log": () -> {}}

liquiddc avatar Feb 17 '14 20:02 liquiddc

Just wanted to update you that this works perfectly on IE9, too.

arabold avatar Mar 26 '14 16:03 arabold

FYI, this line:

console = console or {"log": () -> {}}

Doesn't do what you think it does. It always disables logging, because it makes console into a local variable, which shadows the window.console. So the variable is always empty to start with, and then it's set to the dummy value.

You probably want:

window.console ?= log: ->

instead.

pjeby avatar Apr 22 '14 18:04 pjeby