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

Made script AMD/CommonJS compatible #60

Closed
wants to merge 1 commit into from

Conversation

Rendez
Copy link

@Rendez Rendez commented Jul 29, 2015

In our case, we had cases where we wanted to run the script more than once. This is why I've also taken the change to wrap the module into a UMD factory-style closure. It's the cleanest way to allow exposure of the method, in order to be called at convenience.

@Rendez Rendez mentioned this pull request Jul 29, 2015
@jonathantneal
Copy link
Owner

@Rendez, excellent work. How might this handle the xhr.onload issue that @rjmunro was hoping to resolve? Also, could this wrapper be added as part of a build process?

I’m looking into https://github.com/bebraw/grunt-umd

@Rendez
Copy link
Author

Rendez commented Aug 2, 2015

Yeah, it's a great idea. I am very happy about your feature/2.0.0 branch.

ps: What do you mean about the xhr.onload issue? why does it need to pass this context with bind()?

@Rendez Rendez closed this Aug 2, 2015
@jonathantneal
Copy link
Owner

The issue seemed to do with IE11 throwing an error Unable to get property 'splice' of undefined or null reference.

See: whiteoctober@bf3184a#diff-857c32776517cbdd3f9f587bd3561c73L64

I don’t think there was a isolated example provided though.

@Rendez
Copy link
Author

Rendez commented Aug 2, 2015

If that's true, the XHR object returned to the onload callback is probably a copy of the original XHR object. Without debugging I would assume this is a bug in IE11, and probably IE10 too. Is there a reason to not try onreadystatechange? Perhaps that works out better.

@jonathantneal
Copy link
Owner

The XHR issue has been resolved in 2.0.0 in #62. Please review.

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 this pull request may close these issues.

2 participants