Closed Kreider186 closed 6 years ago
@Kreider186, Please show the code you're running and what was the error message. Thanks.
@panzerdp I was running the voca.js build (directly into browser's web page) and there wasn't any error messages, simply it didn't work at all (with internet explorer, it works perfecly with chrome).
Inspecting the code with explorer's debugger I found that many functions were not supported. So I add the functions above in order to overwrite non-supported functions.
Once overwritten the unsupported functions, the code was still not working and again no exceptions/errors were thrown.
Then, I figured out that here:
ReplacementIndex.prototype.getIndexByPosition = function (position) {
return isNil(position) ? this.index : position - 1;
};
the function was returning -1 because in explorer the value of position wasn't undefined nor null but simply nothing ('').
So I edited the isNil function this way:
function isNil(value) { return value === undefined || value === null || value === ''; }
And now it works.
Please tell me what exact voca function doesnt work in IE. I took a try and everything is ok on my side. Thanks.
Sent from my iPhone
On Feb 8, 2018, at 21:41, Kreider186 notifications@github.com wrote:
@panzerdp I was running the voca.js build (directly into browser's web page) and there wasn't any error messages, simply it didn't work at all (with internet explorer, it works perfecly with chrome).
Inspecting the code with explorer's debugger I found that many functions were not supported. So I add the functions above in order to overwrite non-supported functions.
Once overwritten the unsupported functions, the code was still not working and again no exceptions/errors were thrown.
Then, I figured out that here:
ReplacementIndex.prototype.getIndexByPosition = function (position) { return isNil(position) ? this.index : position - 1; }; the function was returning -1 because in explorer the value of position wasn't undefined nor null but simply nothing ('').
So I edited the isNil function this way:
function isNil(value) { return value === undefined || value === null || value === ''; }
And now it works.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
@panzerdp I've made a pdf with some screenshot and the description of what happened step by step. Hope it helps.
p.s.: the 3rd error was triggered by my my script because I was already replacing some unsupported function (objext.keys and object.values) but I removed the hack for the screenshot report. screenshots.pdf
@Kreider186,
The problem is in meta tag <meta http-equiv="X-UA-Compatible" content="IE=8">
that makes the browser work in IE 8 mode (which does not support Object.keys()
, func.bind()
, etc).
Voca however supports IE 9 and above.
Try to remove this meta tag and see if it works.
@panzerdp Nhope, that doesn't solve the issue. But I tried to replace the meta tag with:
<meta http-equiv="X-UA-Compatible" content="IE=edge">
And at least the last error disappeard (the one on isNil function). Ill'do some other research.
@panzerdp Mmm... what the heck. I've no idea of what happened but today it works. Putting the right meta did the trick and now everything works. Thank you!
You're welcome.
Hi! I tried the voca.js on explorer v11 and it crashed.
I'm not an expert in javascript but I managed to make it work by adding a few lines. Maybe it could be useful to others?
Modifies:
At the very beginning of the file:
And then the function isNil
Now it works.