GithubHelp home page GithubHelp logo

victorquinn / backbone.crossdomain Goto Github PK

View Code? Open in Web Editor NEW
69.0 69.0 22.0 37 KB

A model extension for Backbone.js with a Sync that works with IE 7-9 using its XDomainRequest

License: MIT License

JavaScript 93.15% HTML 6.85%

backbone.crossdomain's People

Contributors

brendonboshell avatar christhomson avatar dependabot[bot] avatar gkorland avatar jcready avatar mcallew avatar robcrawford avatar victorquinn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

backbone.crossdomain's Issues

Version 0.1.0 or 0.3.0?

In Backbone.CrossDomain.js you say it's 0.1.0 but you have tagged the source tree with 0.3.0 a while ago and updated the version in the package.json numerous times. Maybe you'd like to come up with a way of keeping versioning coherent. The reason I'm asking about this is that I have a project where someone has added your Backbone.CrossDomain tweaks as a plain simple js file with nothing extra. Now it just says 0.1.0, which turns out doesn't actually give any real versioning information. So I have no idea which version of your tweaks I've stumbled upon.

Since then it has been further modified to overcome some issues with it, and now I'd like to update it to use the latest of your fixes as well and possibly contribute something back at you too. Now I basically have to diff around your repo commit by commit trying to figure out from which commit it has been created. Then I could branch out from that and apply our changes to it and then try merging it with the head of the master branch and try to resolve the conflicts.... I'm getting a headache here.. :)

Release Tag

Can you please add a release tag so this is manageable with Bower?

Unexpected character at <!DOCTYPE>

Hi,

I have just included the library with my files and when I run the script I get "Unexpected character <" at the first line of the crossDomain.js file. Nor sure what is causing it.

Thanks!

Conflicts when not using json dataType

When using Backbone.sync with dataType: 'jsonp', the library changes the dataType to json an tries to make a CORS call and get the following error on IE9.

image

Would it be usefull to early return when such a happen?

if (options.dataType === 'jsonp') {
  return Backbone.vanillaSync.apply(this, arguments);
}

jQuery.support.cors = true

Hey there,

First of all, your a live saver. Thanks so much for writing this. Our team has to support IE8+ and cross domain requests has been a crappy issue to deal with.

This library seems to work perfectly so far, however I needed to set jQuery.support.cors = true to get it to work properly.

Not sure if this is the case for many other people, but it might be worth looking into adding it right beside useXDomainRequest = true;

Success callback being called twice ?

Hello !

I'm noticing that my "success callback" is being called twice when using IE (So I guess when it uses the XDomainRequest). Anyone here as the same trouble ?

Thanks for the great job anyway !

Syntax error

I just get a Syntax error for Jquery when using this. It relates to this in Jquery, and I've tried serval versions of jquery with the same result.

return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=x.trim(n),n&&E.test(n.replace(A,"@").replace(j,"]").replace(S,"")))?Function("return "+n)():(x.error("Invalid JSON: "+n),t)

Setting X-HTTP-Method-Override doesn't really work

As per http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx point 3, it's not possible to set any headers on XDR. In fact, the xdr prototype doesn't even have any such function.

https://github.com/victorquinn/Backbone.CrossDomain/blob/master/Backbone.CrossDomain.js#L140

var beforeSend = options.beforeSend;
options.beforeSend = function(xhr) {
  xhr.setRequestHeader('X-HTTP-Method-Override', type);
  if (beforeSend) return beforeSend.apply(this, arguments);
};

The code simply doesn't do anything, and I'd recommend deleting it to avoid confusion.

Not available on npm.

โ€บ npm install Backbone.CrossDomain -g
npm http GET https://registry.npmjs.org/Backbone.CrossDomain
npm http 404 https://registry.npmjs.org/Backbone.CrossDomain
npm ERR! 404 'Backbone.CrossDomain' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, or http url, or git url.

npm ERR! System Darwin 12.4.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "Backbone.CrossDomain" "-g"
npm ERR! cwd /Users/tmilewski/Sites/xxx/yyy/Client
npm ERR! node -v v0.10.22
npm ERR! npm -v 1.3.14
npm ERR! code E404
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/tmilewski/Sites/xxx/yyy/Client/npm-debug.log
npm ERR! not ok code 0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.