Skip to content

Instantly share code, notes, and snippets.

@teaholiday89
Created April 1, 2013 23:42
Show Gist options
  • Select an option

  • Save teaholiday89/5288725 to your computer and use it in GitHub Desktop.

Select an option

Save teaholiday89/5288725 to your computer and use it in GitHub Desktop.
jQuery ajax with promises
<snippet>
<content><![CDATA[
\$.ajax({
type: "${1:POST}",
url: ${2:url},
dataType: "json",
data: ${3:json}
}).done(function (data, xhr, textStatus) {
${0}
})${4:.fail(function (xhr, textStatus, error) \{
\})}${5:.always(function (xhr, textStatus) \{
\})};
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>jqajax</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
</snippet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment