Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #3 from mamund/improve-feedback

modify javascript templates to improve feedback
  • Loading branch information...
commit a27695ceddf27873cb19c13c7c33536d2b70f869 2 parents f80ad58 + 2a6e698
@Almad Almad authored
Showing with 6 additions and 3 deletions.
  1. +2 −2 javascript.html
  2. +4 −1 nodejs.html
View
4 javascript.html
@@ -7,8 +7,8 @@
xhr.setRequestHeader(<%= @helpers.escape header %>, <%= @helpers.escape value %>);
<% end %>
xhr.onreadystatechange = function () {
- if (this.status == 200 && this.readyState == 4) {
- alert(this.responseText);
+ if (this.readyState == 4) {
+ alert('Status: '+this.status+\nHeaders: '+JSON.stringify(this.getAllResponseHeaders())+'\nBody: '+this.responseText);
}
};
xhr.send(<%= @helpers.escape @body.join('') %>);
View
5 nodejs.html
@@ -11,7 +11,10 @@
headers: {<%= ("#{@helpers.escape header}: #{@helpers.escape value}" for header,value of @headers).join(", ") %>}, <% end %>
method: "<%= @method.toUpperCase() %>"
}, function (error, response, body) {
-<% end %> console.log("Reponse received", body);
+<% end %>
+ console.log("Status", response.statusCode);
+ console.log("Headers", JSON.stringify(response.headers));
+ console.log("Reponse received", body);
});
</section>
Please sign in to comment.
Something went wrong with that request. Please try again.