Skip to content

Commit

Permalink
Merge pull request madrobby#551 from bnickel/545-load-params
Browse files Browse the repository at this point in the history
Corrected parameters of `load` success callback to match docs and jQuery...
  • Loading branch information
madrobby committed Jul 17, 2012
2 parents 249872d + 96060b1 commit 9ad64d9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ajax.js
Expand Up @@ -250,7 +250,7 @@
self.html(selector ?
$(document.createElement('div')).html(response.replace(rscript, "")).find(selector).html()
: response)
success && success.call(self)
success && success.apply(self, arguments)
})
return this
}
Expand Down
5 changes: 4 additions & 1 deletion test/ajax.html
Expand Up @@ -163,12 +163,15 @@ <h1>Zepto Ajax unit tests</h1>
testAjaxLoad: function(t) {
var testEl = $('#ajax_load')
t.pause()
var el = testEl.load('fixtures/ajax_load_simple.html', function(){
var el = testEl.load('fixtures/ajax_load_simple.html', function(response, status, xhr){
var that = this
deferredResume(t, function(){
this.assertIdentical(testEl, that)
this.assertEqual('simple ajax load', testEl.html().trim())
this.assert(response)
this.assertEqual('success', status)
})
t.assertIn('abort', xhr)
})
t.assertIdentical(testEl, el)
},
Expand Down

0 comments on commit 9ad64d9

Please sign in to comment.