Questions tagged [asynccallback]

A callback is a piece of executable code that is passed as an argument to other code, which is expected to call back (execute) the argument at some convenient time. An asynchronous or deferred callback is invoked after a function returns, or at least on another thread’s stack.

A callback is a piece of executable code that is passed as an argument to other code, which is expected to call back (execute) the argument at some convenient time. An asynchronous or deferred callback is invoked after a function returns, or at least on another thread’s stack.

More Info

457 questions
0
votes
1 answer

How to change a global variable from the inside of a anonymous function?

I have the following function: var checkExist = function(_id) { var t; car.count({ id: _id }, function(err, c) { if (c != 0) { t = 0; console.log(t); } else { t = 1; console.log(t); } }); …
idntr
  • 3
  • 2
0
votes
3 answers

Jquery .load() callback not firing

Ive been struggling with this for hours now. I can't figure out why my .load() callback is not firing. Can anyone shed any light on this. Thanks for any help. The load it's self works fine. window.addEventListener('popstate', function(event) { …
jstleger0
  • 105
  • 1
  • 14
0
votes
1 answer

javascript: function returns value undefined when assigned to variable

I'm trying to assign a function's return value to a variable, using this stackOverflow article as a template. Here's my code: var host = getHostName(djId, function(name) { return name; }); console.log(host); // undefined :( function…
wkd
  • 231
  • 1
  • 5
  • 16
0
votes
1 answer

Error "Undefined is not a function " Using callback node.JS

I am trying to save a new Document (user) in my MongoDb and I use callback. The code runs and goes until save the user, but after that I get an error.So I can save user. I have the following code: function saveUser(userName, socialMediaType,…
Andressa Pinheiro
  • 1,517
  • 2
  • 18
  • 28
0
votes
1 answer

Return empty array or error

I have nodejs accessing a database to retrieve a row of orders. The following function is defined in a file called orderDb.js module.exports.getWaitingOrders = function getWaitingOrders(callback) { pool.query("SELECT * FROM live_order_table…
sfabriece
  • 121
  • 2
  • 10
0
votes
2 answers

Prevent client code until asynccallback completes

I am using GWT. In my client side code I am calling service method. With that method i am getting values from database and with that values I am performing some logical operation. What happened is in success method until it completed rest of the…
VijayKumar
  • 11
  • 1
  • 2
  • 5
0
votes
1 answer

AJAX data transfer between angularjs front-end and nodejs back-end

FYI: There is main question on the bottom if you ever feel like my post is too long ;) Im trying to build my first angularjs app and now Im stuck with collecting data via ajax from nodejs (express) server. In front-end Im loading templates with…
sharko
  • 382
  • 1
  • 13
0
votes
1 answer

how to wait for all AsyncCallback to return in asp.net

I'm using multi-threaded database query to retrieve several data tables at once. I've used a list which is locked...and once all the callbacks are returned, I want to return the list. I want to know how to wait for all the callbacks to…
max
  • 9,708
  • 15
  • 89
  • 144
0
votes
1 answer

Callback function running unexpectedly

There is a small code i have written below and issue is explained within comments. Problem is with the bold callback function while creating the collection. There is an error while creating the collection and the message should be displayed as soon…
logeekal
  • 525
  • 4
  • 13
0
votes
1 answer

Return value inside Facebook request OnComplete

My doubt is, when i call a method below, the value is null, of course, because the object user it's not already populated, because will be populated inside Facebook request. So, the question is, how can i wait for the facebook complete and then…
Renan Nery
  • 3,475
  • 3
  • 19
  • 23
0
votes
3 answers

What happens when an asynchronous callback calls a virtual function, while base class constructor is not returned yet?

I have the following scenario: class Caller{ public: Caller() {...} void register(Base* b) {...} void callBase() { b->virt()} }; class Base { public: Base(Caller c) { println("Base::Base()"); c.register(this); sleep(30);…
user1819676
  • 369
  • 1
  • 12
0
votes
0 answers

Delegate CallBack method from interface without passing it as param

Hello great community :) I'm implementing my own network wrapper here and have few questions: 1) The idea: I want to do static "Network" class and refer to it as for example: public class NetworkTest { public void StartPoint() { …
Bryksin
  • 2,322
  • 3
  • 19
  • 31
0
votes
1 answer

My GWT RPC AsyncCallback doesn’t work: InvocationException

I developed a GWT application and make a AsyncCallback a jfreechart generated in server side. But there is an error returning a InvocationException. The detailed error message is here 404 html…
0
votes
0 answers

AJAX Asynchronous Callback Function - what is the parameter/argument passed in?

I have an asynchronous ajax function, complete with a callback: var coreChat = { fetch: function (fn) { $.ajax({ url: "https://api.parse.com/1/classes/chats", data: { order: 'createdAt', …
Seeeyonnn
  • 315
  • 2
  • 10
  • 19
0
votes
3 answers

DIfficulty determining what 'this' refers to in JS/jQuery code

I'm experiencing difficulty figuring out what 'this' refers to, in multiple instances of the following code: jQuery(function ($) { var coreChat = { fetch: function (fn) { $.ajax({ url:…
Seeeyonnn
  • 315
  • 2
  • 10
  • 19