ractivejs / ractive-load

Import templates and components using AJAX
ractivejs.github.io/ractive-load
MIT License
55 stars 10 forks source link

typeof XMLHttpRequest causes malfunction in Safari #9

Closed gggritso closed 10 years ago

gggritso commented 10 years ago

Heya!

The line

if ( typeof XMLHttpRequest === 'function' ) {

doesn't work as expected in Safari. There, typeof XMLHttpRequest actually returns object, which causes the script to try and use fs.readFile and breaks in the browser.

I'm not familiar enough with the Node environment (i.e. how fs is recognized) to do a pull request here, or I would.

In any case, cheers!

MartinKolarik commented 10 years ago

@gggritso Thanks. Fixed and published v0.3.1 on GitHub.

@Rich-Harris please npm publish

Rich-Harris commented 10 years ago

@MartinKolarik done, thanks

gggritso commented 10 years ago

Thanks guys!