Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross Domain and IE10 #56

Closed
f1hornet opened this issue Jan 8, 2016 · 8 comments · Fixed by #58
Closed

Cross Domain and IE10 #56

f1hornet opened this issue Jan 8, 2016 · 8 comments · Fixed by #58

Comments

@f1hornet
Copy link

f1hornet commented Jan 8, 2016

Hey
when I try to use this with IE10 (works great with ie11, chrome) I get an error:

SCRIPT5: Access is denied.
xapiwrapper.js, line 1342 character 13

This is the line it refers to:
xhr.open(ieModeRequest.method, ieModeRequest.url);

Any ideas how to fix this - having the course on a secure server makes no diffence.

Sorry - pressed submit before adding the error!

John

@creighton
Copy link
Contributor

what's the error?

@f1hornet
Copy link
Author

f1hornet commented Jan 8, 2016

Hi Creighton - I updated my comment now

@f1hornet
Copy link
Author

f1hornet commented Jan 8, 2016

trying to connect to a WAX LRS: https://isl.waxlrs.com/TCAPI/

@creighton
Copy link
Contributor

hmm.. ok. we'll try it out here and see what we can find.. sorry I don't have a quick answer for you

@f1hornet
Copy link
Author

f1hornet commented Jan 8, 2016

Thanks for your help... I reverted back to your example.html file as a simple example to try and debug the issue but I'm not making any progress. We are running it from a http connection to the https LRS but even moving the file to https made no difference. As I mentioned before it works perfectly in IE11 and Chrome but our client wants it on older browsers - even as far back as IE8! :(

I really appreciate any help you can provide.

@f1hornet
Copy link
Author

f1hornet commented Jan 8, 2016

Hi Tom,
I came up with a solution that seems to be working:

Change:
//If it's not cross domain or we're not using IE, use the usual XmlHttpRequest
if (!xDomainRequest || typeof(XDomainRequest) === 'undefined') {

To:

//If it's not cross domain or we're not using IE, use the usual XmlHttpRequest
var windowsVersionCheck = window.XDomainRequest && (window.XMLHttpRequest && new XMLHttpRequest().responseType === undefined);
if (!xDomainRequest || windowsVersionCheck === undefined || windowsVersionCheck===false) {

based on this article:
http://stackoverflow.com/questions/15460152/how-to-determine-whether-to-use-xmlhttprequest-or-xdomainrequest

Let me know if you think this will work

thanks

John

@ljwolford
Copy link
Contributor

Hi John,

We tested it on our side and it appears to be working. Thank you for finding this bug and fixing it! I'll be creating a pull request to include it in the code.

creighton added a commit to creighton/xAPIWrapper that referenced this issue Jan 8, 2016
creighton added a commit that referenced this issue Jan 8, 2016
@shigil
Copy link

shigil commented May 4, 2017

Hi

I ran into a problem while using this API with IE10. The API was throwing invalid state error in IE 10 while trying to fetch statements.

Debugging further I realized that the issue was actually with the xhr.withCredentials in the ADL.XHR_request function. Moving it after xhr.open fixed the issue. Is it possible to raise a pull request to include it in the code?

xhr.open(method, url, callback != null);
xhr.withCredentials = withCredentials;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants