Reputation: 4109
I have this:
$.ajax({
url: '/autocomplete',
type: 'GET',
dataType: 'json',
success: function(data) {
alert(data);
}
});
and trying to mock it with:
$.mockjax({
url: '/autocomplete',
type: 'GET',
responseTime: 50,
responseText: function() {
this.responseText = {info: 'Merge !!!'};
}
});
I'm getting NULL as a response from mocjax.
What am I doing wrong? How can I use the response function in mockjax
Upvotes: 0
Views: 667
Reputation: 4109
Instead of
responseText
it should be just
response
So, the correct version is:
response: function() {
this.responseText = {info: 'Merge !!!'};
}
Upvotes: 1