Skip to content

Instantly share code, notes, and snippets.

@Chun-Yang
Created May 29, 2014 15:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Chun-Yang/be5a561f4ba937b3343f to your computer and use it in GitHub Desktop.
Save Chun-Yang/be5a561f4ba937b3343f to your computer and use it in GitHub Desktop.
js jquery ajax
<snippet>
<content><![CDATA[
\$.ajax({
url:'/ajax/${1:controller}/${2:action}',
data:{
${3}
},
dataType:'json',
type:'POST',
success:function (response) {
if (response.success) {
${4}
}
else {
${5}
}
}
});
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>ajax</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.js</scope>
</snippet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment