Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added javascript template

  • Loading branch information...
commit 57b29945b45ad084bed658d6da4afe7799180db6 1 parent 09515bb
@gr2m gr2m authored zzen committed
Showing with 16 additions and 0 deletions.
  1. +16 −0 javascript.html
View
16 javascript.html
@@ -0,0 +1,16 @@
+<section name="javascript">
+ <p class="ioDesc">In</p>
+ <pre class="incoming brush:javascript">
+ var xhr = new XMLHttpRequest();
+ xhr.open('<%= @method.toUpperCase() %>', '<%= @apiUrl %><%= @url %>');
+ <% for header, value of @headers: %>
+ xhr.setRequestHeader("<%= header %>", "<%= value %>");
+ <% end %>
+ xhr.onreadystatechange = function () {
+ if (this.status == 200 && this.readyState == 4) {
+ alert(this.responseText);
+ }
+ };
+ xhr.send(<%= @helpers.escape @body.join('') %>);
+ </pre>
+</section>

0 comments on commit 57b2994

Please sign in to comment.
Something went wrong with that request. Please try again.