<!DOCTYPE html>
    <html lang="en">
        <head>
            <meta charset="utf-8">
                <title>Jaggery - Delicious Javascript</title>
                <meta name="description" content="">
                    <meta name="author" content="">

                        <!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
                        <!--[if lt IE 9]>
                        <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
                        <![endif]-->

                        <!-- Le styles -->
                        <link href="../css/bootstrap.css" rel="stylesheet">
                            <style type="text/css">
                            body {
                                padding-top: 60px;
                                }
                            </style>
                            <link href="../css/prettify.css" rel="stylesheet">
                                <!-- Le fav and touch icons -->
                                <link rel="shortcut icon" href="../images/favicon.ico">
                                    <link rel="apple-touch-icon" href="../images/apple-touch-icon.png">
                                        <link rel="apple-touch-icon" sizes="72x72"
                                        href="../images/apple-touch-icon-72x72.png">
                                            <link rel="apple-touch-icon" sizes="114x114"
                                            href="../images/apple-touch-icon-114x114.png">
                                            </head>

                                            <body>

                                                <%
                                                include('/includes/topnavi.jag');
%>

<div class="container-fluid" style="width: 960px; margin: auto;">
<div class="row">
    <div class="span16">
        <div class="page-header">
            <h1  id="top">
                Documentation
                <small>API documentation for Jaggery.js</small>
            </h1>
        </div>
    </div>
</div>

<div class="row">
<div class="span4">
    <div class="well">
        <%
        include('/includes/navi.jag');
        %>

    </div>

</div>
<div class="span12">
<div class="content" id="put" name="put">
<h3>put()</h3>

<pre class="prettyprint linenums">
&lt%
var data = {'key':'value'}; 
var headers = {'key', 'value'};
put(url, data, "text", headers, function (data, xhr) {
       log("Response received");
   }
);
%&gt
</pre>

    <% hasRets = false; %>
    <div id="pageLinks">
        <a class="navilink" href="#overview">Overview</a>
        <%if(hasParams) {%>
        <a class="navilink" href="#parameters">Parameters</a>
        <%}%>
        <%if(hasRets) {%>
        <a class="navilink" href="#returnVals">Return values</a>
        <%}%>
    </div>

<section id="overview">

<h4>Overview</h4>
<p class="description"><code>put()</code> is a wrapper for XMLHTTPRequest's PUT method.
using <code>put()</code> you can avoid the use of XHR and shorten the server-side PUT requests</p>
    <pre class="prettyprint">put(url[, data][, type][, headers][, success(data, xhr)])</pre>
    <pre class="prettyprint">var res = put(url[, data][, type][, headers])</pre>
</section>

    <section id="parameters">
        <h4>Parameters</h4>
        <table class="clsStd operations-table">

            <tbody>

            <tr>

                <th>Parameter</th>
                <th>Type</th>
                <th>Description</th>

            </tr>

            <tr>
                <td><code>url</code></td>
                <td>String</td>
                <td>The URL which HTTP PUT is performed </td>
            </tr>
            <tr>
                <td><code>data</code></td>
                <td>Object</td>
                <td>Request parameters</td>
            </tr>
            <tr>
                <td><code>type</code></td>
                <td>String</td>
                <td>The type, which the response is expected</td>
            </tr>
            <tr>
                <td><code>headers</code></td>
                <td>String</td>
                <td>Optional HTTP headers</td>
            </tr>
            <tr>
                <td><code>success(data:Object,<br/> xhr:Object)</code></td>
                <td>function</td>
                <td>On success callback</td>
            </tr>
            </tbody>
        </table>
    </section>


    <section id="returnVals">
        <h4>Return values</h4>
        <table class="clsStd operations-table">
            <tbody>
            <tr>
                <th>Value</th>
                <th>Type</th>
                <th>Description</th>
            </tr>
            <tr>
                <td><code>data</code></td><td>Object</td><td>Contains the return data of the HTTP PUT request</td>
            </tr><tr>
                <td><code>xhr</code></td><td>Object</td><td>Contains an instance of XMLHTTPRequest</td>
            </tr>
            </tbody>
        </table>
    </section>
</div>
<!-- /put div -->
<br>
<br>
</div>

</div>
<%
include('/includes/footerfunc.jag');
%>


</div>
<!-- /container -->
<%
include('/includes/scripts.jag')
%>

	<script>

		$(document).ready(function(){
        $('#put').toggleClass('active')
		$('#docs').addClass('active')
        });




	</script>
</body>
</html>