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

Doesn't work in IE8. #6

Open
jimmyye opened this issue Jul 4, 2014 · 5 comments
Open

Doesn't work in IE8. #6

jimmyye opened this issue Jul 4, 2014 · 5 comments

Comments

@jimmyye
Copy link

jimmyye commented Jul 4, 2014

typeof XMLHttpRequest === 'function' // normal browsers
typeof XMLHttpRequest === 'object'   // IE8
@jonvuri
Copy link

jonvuri commented Jul 4, 2014

Seems that XMLHttpRequest isn't defined (at least, the normal way) in IE7/8: http://stackoverflow.com/questions/2363212/window-xmlhttprequest-is-undefined-in-ie7-ie8

We could also check for ActiveXObject but maybe it would be better to switch to a proper AJAX micro-lib?

@violinchris
Copy link

i am thinking safari has the same problem

@MartinKolarik
Copy link
Member

@violinchris The problem with Safari has been solved (#9). We'll need to use ActiveXObject for IE 8 though.

@Rich-Harris
Copy link
Member

Maybe the best solution is to expose the get() function so that it can be overwritten. That way if someone needs to support IE8 they can do

Ractive.load.get = function ( url ) {
  return new Ractive.Promise( function ( fulfil, reject ) {
    // use library of choice
    var request = someAjaxLib({
      url: url,
      onload: function () {
        fulfil( request.response );
      },
      onerror: reject
    });
  });
};

It'd be a shame to have to include another lib just to support a handful of laggards.

Or maybe we have two build targets with different requirejs configs - i.e. add a sibling to compile in this file where the paths object has something like

get: 'utils/get-legacy'

Then we could include a proper AJAX micro-lib (I assume, given that there's so many of them, that there's a bit of work involved in getting ActiveXObject to behave? Never looked into it).

@MartinKolarik
Copy link
Member

@Rich-Harris I'm not 100 % sure, but I think that ActiveXObject would work exactly like XMLHttpRequest. If that was not the case then I think having legacy build would be the best option.

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

No branches or pull requests

5 participants