Get lmsAPI in HTML5 and Flash included IE8 Aug 05, 2019 By Michel Toyos I have a problem to get lmsAPI If I use HTML5 navigator: function findLMSAPI(win) {if (win.hasOwnProperty("GetStudentID")) return win;else if (win.parent == win) return null;else return findLMSAPI(win.parent);}var lmsAPI = findLMSAPI(this); WORKS FINE but if I use IE8 Don´t work this javascript but works this one: var lmsAPI = parent; How can I do for all navigators? THANKS
Russell Killips over 4 years ago08/06/19 at 2:30 pm (UTC) I cannot test this but checkout this website: http://perrymitchell.net/article/ie8-javascript-indexof-hasownproperty/
Michel Toyos Author over 4 years ago08/23/19 at 1:19 am (UTC) Thanks. I found a solution. function findLMSAPI(win) { if (win.hasOwnProperty("GetStudentID")) return win; else if (win.parent == win) return null; else return findLMSAPI(win.parent);}if (navigator.appVersion.indexOf("MSIE") != -1) { if (parseInt(navigator.appVersion.charAt(0)) < 9) { var lmsAPI = parent; } } else { var lmsAPI = findLMSAPI(this); }
2 Replies
I cannot test this but checkout this website:
http://perrymitchell.net/article/ie8-javascript-indexof-hasownproperty/
Thanks.
I found a solution.
This discussion is closed. You can start a new discussion or contact Articulate Support.