Code Monkey home page Code Monkey logo

promisejs's People

Contributors

armoucar avatar bafs avatar stackp 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

promisejs's Issues

X-Requested-With should be manually set

This should be set through the promisejs options flag:

// xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');

When set hardcoded, some users (like me) have problems with cross site scripting :-)

delete is a keyword

delete is a keyword in javascript and might lead to problems when use as an identifier (as done in the last line of promisjs)

How to access response headers

Sorry if this has been answered but could not find by searching..

I need to access a custom response header (Date) in my ajax calls, how do I go about this?

License?

Hi, I would like to use your library, but I do not see a license for it.

Publish on npm

Thanks for this library.

It would be great if promisejs could be installed via npm. Bower would be useful too but I don't personally need that.

How can I chain ajax requests?

I want to achieve something like this:

`promise.chain([

promise.get('some-url-1'),

promise.get('some-url-2'),

promise.get('some-url-3')

]).then(

function(err, n) {

    // get the responses here .. 

}

);`

Can you advise please.

NPM package

Very useful plugin. Thank you!
Why not publishing it to NPM repo and simplify its usage as a node package dependency?

Greetings!

Create gh-pages branch to serve promise.js and promise.min.js for remote use

Playing by using your library, I got an usual message "Refused to execute script from 'https://raw.github.com/stackp/promisejs/master/promise.min.js' because its MIME type ('text/plain') is not executable, and strict MIME type checking is enabled." in Chrome.
The solution is to serve files using gh-pages because of Github evolution (https://github.com/blog/1482-heads-up-nosniff-header-support-coming-to-chrome-and-firefox)

promise.join([]) never goes to done

I don't know if it's indeed a bug; but if you write this

promise.join([]).then(function() { console.log('done!'); })

it never console.logs "done!".

Is this still being looked upon?

Hi all,

Like the title says, is this library still being looked upon?
If so, I was testing out "promises" based functionality of my js on personal blog. Everything else works as one would expect however, the promise.post fails to pass on new FormData("myFormElement");

Now when its all text based, I can serialize and send it in data field. But my form data also has images / pdfs which I upload and that is not being received by the server and neither is it being sent (confirming that based on console checks and network tabs).

I checked the source and I see payload = _encode(data);.

Any help?

Code I am using:

<form name="submitnewcontent" id="myForm" method="post" action="/submit">
    <input type="text" name="Text" title="title" />
    <br />
    <input name="fileu" type="file" accept="image/*">
    <br/>
    <input type="submit" value="Go" id="submitbutton" />
</form>
<script>
$('#submitbutton').onclick(function(){
promise.post('/z/index.php',new FormData(document.getElementById("myForm")));
});
<script>

AJAX requests randomly aborted in IE9

I use this library to perform my AJAX calls and I've noticed that on MSIE 9, some AJAX (not all) would get aborted by the browser for no reason.

I've found this thread on StackOverflow http://stackoverflow.com/questions/15786966/xdomainrequest-aborts-post-on-ie-9 and tried the suggested fix and it seemed to work better (no more randomly aborted AJAX calls).

What I've done is define an empty function
xhr.onprogress = function () { };
in the first try...catch block of the ajax method.

Thanks for your time

Support timeout for ajax requests

It would be fantastic if promise.js would support a timeout feature.

In my case (mobile app with phonegap) I sometimes loose connectivity. Therefore it would be great if the request would be finished after a while and an error is thrown (or something like that)

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.