From e9ece38636aaab61c9454dc2167e103e3ab7e5ce Mon Sep 17 00:00:00 2001 From: Piotr Yordanov Date: Fri, 3 Jan 2014 06:37:03 +0000 Subject: [PATCH] Added Ajax for Coffescript --- snippets/coffee.snippets | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/snippets/coffee.snippets b/snippets/coffee.snippets index aca6e81..7ed1ebf 100644 --- a/snippets/coffee.snippets +++ b/snippets/coffee.snippets @@ -93,3 +93,17 @@ snippet req # Export snippet exp ${0:root} = exports ? this + + +snippet ajax + $.ajax + url: "${1:mydomain.com/url}" + type: "${2:POST}" + dataType: "${3:xml/html/script/json}" + data: ${4:data} + complete: (jqXHR, textStatus) -> + ${5:// callback} + success: (data, textStatus, jqXHR) -> + ${6:// success callback} + error: (jqXHR, textStatus, errorThrown) -> + ${0:// error callback}