Questions tagged as 'callback'

4
answers

What is callback?

I see in many codes and even architectures the word callback, I see that it is in JavaScript functions. But what is it? How is it used? Why? I would like an example of actual usage.     
asked by 31.07.2014 / 00:14
3
answers

What is the real advantage of using a CallBack and what is thread / multithread?

It has a lot of explanation of what is callback by the net and even a few sparse examples, but nothing that explains in practice and in detail a really important use (I did not find it). I already understood a bit of how to use and even mad...
asked by 02.01.2015 / 22:48
2
answers

What is the hell of the callbacks?

Going through some recent research, I came up with an unfamiliar term for myself: "The callback hell." I was curious and decided to research a little, arriving at the following code snippet: fs.readdir(source, function (err, files) { if (...
asked by 08.03.2017 / 14:11
1
answer

AngularJS - What is the best practice when uploading images?

I've implemented this solution to upload the images: MaquinaResource.save($scope.maquina, function (data, responseHeaders) { var formDataImage = new FormData(); for(var i = 0 ; i < $scope.images.length; i++) { formDataImage.ap...
asked by 21.06.2016 / 15:36
2
answers

How to get the instance itself in a callback?

class Cat { constructor(name, picture) { this.name = name; this.picture = picture; this.count = 0; // ... this.img.click(function () { this.count++; // não funciona como eu espero...
asked by 06.09.2017 / 23:57
1
answer

What is server-to-server callback?

I would like to know if it is a concept, I am using a service that informed me that the information can be obtained via callback server-to-server, but I did not exactly understand the meaning of the term.     
asked by 29.06.2018 / 15:18
1
answer

Scope in asynchronous call (Javascript)

Let's suppose I had the following method: this.loadCustomers = function(){ Request.get("php/loadCustomersAction.php", (function(error, data){ if(!error) this.setCustomers(data); }).bind(this)); }; where "Request....
asked by 14.06.2017 / 19:14
2
answers

JSON API Callback

I have a question on how to filter results from a API , and would like to know if anyone has had this problem before. Let's say that we have to access a API that is on a server other than ours and returns a response in JSON...
asked by 18.10.2015 / 05:44
4
answers

Passing javascript object by parameter in ajax callback

I know to pass string: onclick="popularEdicaoRetrofit(\''+data[i]+'\');" and number: var criarRetrofit = onclick="criarRetrofit('+data[i].idRetrofit+');" I would like to know how to pass an object as a parameter to the javascript funct...
asked by 02.07.2015 / 15:36
2
answers

How to execute a function whose name was passed as parameter of another function, à the callback?

I created this function in order to abstract the $.ajax() calls to be executed at several different times. One of its parameters is the name of one of the functions that I would like it to run on success. However, how should I call thi...
asked by 10.05.2018 / 05:34