anima-yocto-ajax
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -5,2 +5,6 @@ # History | ||
## 1.0.5 | ||
`fixed` 为beforeSend、success、error、complete方法增加前置判断,防止直接调用ajaxJSONP方法报错 | ||
## 1.0.4 | ||
@@ -7,0 +11,0 @@ |
{ | ||
"name": "anima-yocto-ajax", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "the ajax from yocto", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
// triggers an extra global event "ajaxBeforeSend" that's like "ajaxSend" but cancelable | ||
function ajaxBeforeSend(xhr, settings) { | ||
var context = settings.context | ||
if (settings.beforeSend.call(context, xhr, settings) === false) | ||
if (settings.beforeSend && settings.beforeSend.call(context, xhr, settings) === false) | ||
return false | ||
@@ -9,3 +9,3 @@ } | ||
var context = settings.context, status = 'success' | ||
settings.success.call(context, data, status, xhr) | ||
settings.success && settings.success.call(context, data, status, xhr) | ||
if (deferred) deferred.resolveWith(context, [data, status, xhr]) | ||
@@ -17,3 +17,3 @@ ajaxComplete(status, xhr, settings) | ||
var context = settings.context | ||
settings.error.call(context, xhr, type, error) | ||
settings.error && settings.error.call(context, xhr, type, error) | ||
if (deferred) deferred.rejectWith(context, [xhr, type, error]) | ||
@@ -25,3 +25,3 @@ ajaxComplete(type, xhr, settings) | ||
var context = settings.context | ||
settings.complete.call(context, xhr, status) | ||
settings.complete && settings.complete.call(context, xhr, status) | ||
} | ||
@@ -28,0 +28,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12913