Skip to content
This repository has been archived by the owner on Apr 18, 2019. It is now read-only.

Commit

Permalink
CB-6450 added support for local XHR.responseXML getter
Browse files Browse the repository at this point in the history
  • Loading branch information
purplecabbage committed Apr 25, 2014
1 parent 30fba42 commit 67715e0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions wp7/template/cordovalib/XHRHelper.cs
Expand Up @@ -226,6 +226,11 @@ public void InjectScript()
alias.status = responseCode;
if (responseCode == '200') {
alias.responseText = responseText;
Object.defineProperty(alias, 'responseXML', {
get: function () {
return new DOMParser().parseFromString(this.responseText, 'text/xml');
}
});
}
else {
alias.onerror && alias.onerror(responseCode);
Expand Down
5 changes: 5 additions & 0 deletions wp8/template/cordovalib/XHRHelper.cs
Expand Up @@ -226,6 +226,11 @@ public void InjectScript()
alias.status = responseCode;
if (responseCode == '200') {
alias.responseText = responseText;
Object.defineProperty(alias, 'responseXML', {
get: function () {
return new DOMParser().parseFromString(this.responseText, 'text/xml');
}
});
}
else {
alias.onerror && alias.onerror(responseCode);
Expand Down

0 comments on commit 67715e0

Please sign in to comment.