Skip to content

Commit

Permalink
$osf, not $.osf
Browse files Browse the repository at this point in the history
  • Loading branch information
sloria committed Feb 5, 2015
1 parent 660319a commit 52ef7bd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions docs/osf/guidelines.rst
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ All client-side HTTP requests should have proper error handlers. As an example,
.. code-block:: javascript
var url = '/api/v1/profile';
var request = $.osf.putJSON(url, {'email': 'foo@bar.com'});
var request = $osf.putJSON(url, {'email': 'foo@bar.com'});
request.done(function(response) { ... });
Expand All @@ -202,12 +202,13 @@ All client-side HTTP requests should have proper error handlers. As an example,
});
});
When appropriate, you can use the generic `$.osf.handleJSONError`, which will display a generic error message in a modal to the user if a failure occurs.
When appropriate, you can use the generic `$osf.handleJSONError`, which will display a generic error message in a modal to the user if a failure occurs.

.. code-block:: javascript
var $osf = require('osfHelpers');
// ...
request.fail($.osf.handleJSONError);
request.fail($osf.handleJSONError);
Documentation
*************
Expand Down
4 changes: 2 additions & 2 deletions docs/style_guides/javascript.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ Follow `Abhinay Rathore's jQuery Coding Standards Guide <http://lab.abhinayratho
AJAX
----

For PUTting and POSTing to JSON endpoints in the OSF, use the ``$.osf.postJSON`` and ``$.osf.putJSON`` functions (located in ``site.js``). This will handle JSON stringification as well as set the correct dataType and contentType.
For PUTting and POSTing to JSON endpoints in the OSF, use the ``$osf.postJSON`` and ``$osf.putJSON`` functions (located in ``osfHelpers.js``). This will handle JSON stringification as well as set the correct dataType and contentType.

When using ``$.osf.postJSON``, ``$.osf.putJSON``, or ``jQuery.ajax``, use the Promises interface.
When using ``$osf.postJSON``, ``$osf.putJSON``, or ``jQuery.ajax``, use the Promises interface.

.. code-block:: javascript
Expand Down

0 comments on commit 52ef7bd

Please sign in to comment.