Overlib.js not working in Internet Explorer 10 (IE 10)
The overlib.js fail to work in IE 10. The error that is usually thrown in the console is "SCRIPT5007: Unable to get property '1' of undefined or null reference "
I investigated and found that the code simply considers the browser version to be only 1 digit. So, when we use IE 10, this does not match.
There is a simple solution though.
In the overlib.js file, line #216 the code is as below:
var versNum = parseFloat(agent.match(/MSIE[ ](\d\.\d+)\.*/i)[1]);
Change this to
var versNum = parseFloat(agent.match(/MSIE[ ](\d{1,2}\.\d+)\.*/i)[1]);
This code will work at least till IE 99 :-)
I investigated and found that the code simply considers the browser version to be only 1 digit. So, when we use IE 10, this does not match.
There is a simple solution though.
In the overlib.js file, line #216 the code is as below:
var versNum = parseFloat(agent.match(/MSIE[ ](\d\.\d+)\.*/i)[1]);
Change this to
var versNum = parseFloat(agent.match(/MSIE[ ](\d{1,2}\.\d+)\.*/i)[1]);
This code will work at least till IE 99 :-)
Comments
Olivier
When I searched for overlip on google, in the third position I could see your blog with you photograph. The fix that you have posted related to IE 10 is helpful for all those who are using overlib. Thanks.
Well done!!!
Sachin Jos
Havas World Wide Muscat (Digital)
you are the man.
From Hungary.