Open liquiddc opened 10 years ago
Thanks for this patch. I'll check it out, too. 2 comments though:
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?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.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": () -> {}}
Just wanted to update you that this works perfectly on IE9, too.
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.
These changes make dashing-js work with IE10