iron-ajax
iron-ajax copied to clipboard
Send and reSend problem
Description
I use one iron-request component to send different requests to php for editing MariaDb database.
The problème I have is if I send a request, I cannot reuse the same xhr, cause is readyState is at 4 (which mean Done)
I have a suggestion for a correction for the send command :
send: function(options) {
var xhr = this.xhr;
if (xhr.readyState > 0 && xhr.readyState != 4 /* DONE */ ) {
return null;
}
(adding
&& xhr.readyState != 4 /* DONE */
works for me)
Expected outcome
Using multiple time in a componnent the same xhr.
Actual outcome
Can only use one time the xhr componnent
Live Demo
Steps to reproduce
Browsers Affected
- [x] Chrome
- [ ] Firefox
- [ ] Safari 9
- [ ] Safari 8
- [ ] Safari 7
- [ ] Edge
- [ ] IE 11
- [ ] IE 10
I came here for this exact reason. It was driving me nuts and I didn't know what I was doing wrong.
It looks like iron-ajax is dynamically creating a new iron-request for every new send.