Skip to content

Commit

Permalink
Fix custom fields application
Browse files Browse the repository at this point in the history
xhr was not in scope. xdr was intended. This is fixed.
Using $.extend() means we do not have to specify each field.
Renamed xhrFields to xdrFields. As this is what they are.
Fomerly, property names were unnecessarily translated:
	xhrFields.error -> xhr.onerror
	xhrFields.timeout -> xhr.ontimeout
Now there is no translation, use the exact names:
	xdrFields.onerror -> xdr.onerror
	xdrFields.ontimeout -> xdr.ontimeout
  • Loading branch information
Alex Hutton committed Nov 4, 2014
1 parent e506715 commit 2cdae70
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions jquery.iecors.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@
};

// Apply custom fields if provided
if ( s.xhrFields ) {
xhr.onerror = s.xhrFields.error;
xhr.ontimeout = s.xhrFields.timeout;
if ( s.xdrFields ) {
$.extend(xdr, s.xdrFields);
}

xdr.open( s.type, s.url );
Expand Down

0 comments on commit 2cdae70

Please sign in to comment.