callback

jquery .load callback never called in Internet Explorer

I am downloading files through IFRAME method described here: http://encosia.com/2007/02/23/ajax-file-downloads-and-iframes/ And am showing progress in a div and hiding this div on load completion: $(objIframe).load(function() { $("#spinner").hide(); }); The trouble is, this callback function is never called in Internet Explorer ...

Android Camera JpegPictureCallback with varying input data size problem when takePicture() is called

I called takePicture() and pass it a PictureCallback as a JpegPictureCallback. I'm seeing byte[] data input varies in size within onPictureTaken(). Can someone explain why this byte[]'s content size varies? I'm already setting picture size to a constant size with Camera.Parameters.setPictureSize(); Thanks! ...

Simple jQuery callbacks break in IE.

I have a few functions like this: $(this).find('.subnav').fadeIn(200, buttonHide ); Now, buttonHide, in this case, is a function I've declared elsewhere. Once the 200ms fadeIn is complete, I want to call that function. Great. Works in FF and Safari. In IE, though, it returns an error as undefined. In fact, I experienced the SAME prob...

Can't grab foreign key during after_create callback because it doesn't exist yet!

I have some models all linked together in memory (parent:child:child:child) and saved at the same time by saving the top-most parent. This works fine. I'd like to tap into the after_create callback of one of the children to populate a changelog table. One of the attributes I need to copy/push into the changelog table is the child's f...

Rails Cache Sweeper and Model Callback Firing

Hey guys, I have the following classes: class Vigil < ActiveRecord::Base after_update :do_something_cool private def do_something_cool # Sweet code here end end class NewsFeedObserver < ActionController::Caching::Sweeper observe Vigil def after_update # Create a news feed entry end end Everything works ...

jQuery callback function does not work

I'm trying to use the following code to make an image fadeOut and, only when it's faded out, change its source, and then make it fadeIn again: $('.liitem').click(function() { $('#imagen').fadeOut('slow', function() { var rutaimagen = $(this).find('a').attr("href"); $('#imagen').attr("src",rutaimagen).load(function(){ $('#im...

How to execute a page ,that contains JS ,in AJAX ,using innerHTML?

I send GET data with AJAX to another file.And on the another file I have echo "<script>alert('Something');</script>";.This is displayed dynamicly with AJAX ,i.e var ajaxDisplay = document.getElementById('edit'); ajaxDisplay.innerHTML = ajaxRequest.responseText; puts the <script>alert('Something');</script> to div with name edit. But ...

Iphone, callback and objective c

Hi, I am using a c++ library using callback to inform about the progress of an operation. Everything is working fine except this: I need to have a function in my controller to be use as a c++ callback function. I've tried a lot of things but none of them are working. Do you know how we can manage this kind of thing? Thanks :) ...

WCF Windows Service - Long operations/Callback to calling module

I have a Windows Service that takes the name of a bunch of files and do operations on them (zip/unzip, updating db etc). The operations can take time depending on size and number of files sent to the service. (1) The module that is sending a request to this service waits until the files are processed. I want to know if there is a way to...

Why callback functions needs to be static when declared in class

I was trying to declare a callback function in class and then somewhere i read the function needs to be static but It didn't explain why? #include <iostream> using std::cout; using std::endl; class Test { public: Test() {} void my_func(void (*f)()) { cout << "In My Function" << endl; f(); //Invoke callback ...

Avoid stuck calling callback

Hello all, This is a question about generic c++ event driven applications design. Lets assume that we have two threads, a "Dispatcher" (or "Engine"...) and a "Listener" (or "Client"...). Let's assume that I write the Dispatcher code, and release it as a library. I also write the Listener interface, of course. When the Dispatcher execut...

External class-calling

Hi guys i have a bit of a problem with a few classes, and i would be very grateful if someone can help me out. So i have: Already compiled executable (for whom i don't have the source) A class in that program that i want to call The program doesn't have export for the class, and that's my problem i don't have definition for this clas...

jQuery $.ajax(), pass success data into separate function

I am using the jQuery $.ajax() function. I have put this into a parent function, which passes some values into the ajax function. What I would like to do, is have a user defined callback function, which gets the data param passed in from the ajax success function. Here is what I was thinking would work, but it is not: testFunc = func...

javascript curtain (used to idicate busy process) not displaying for entire process. Probaly I dont understand the callback wll enough.

I have a process where a user puts in a comma delimited list that is then processed one item at a time. I want to be able to indicate to the user that it is processing and let them know when it is done. So I used the curtain idea from Borgar's replay to ... Div Over Page. This worked but the curtain disappears well before the process is ...

How to retrieve salt if using HTTP authentication scheme ?

Hello Is it possible to use salted password along with standard HTTP authentication schemes ( FORM or DIGEST ) ? I am using GlassFish, and when I request a protected page, the form or the answer with the nonce are sent back directly by the server. I can't see any obvious way to hook into the server mechanism to insert the salt in the 3...

C# wrapper and Callbacks

I'm in the process of writing a C# wrapper for Dallmeier Common API light (Camera & Surviellance systems) and I've never written a wrapper before, but I have used the Canon EDSDK C# wrapper. So I'm using the Canon wrapper as a guide to writing the Dallmeier wrapper. I'm currently having issues with wrapping a callback. In the API manual...

C# wrapper of c++ dll; "Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call." error

Here is the code in C++ dll: extern "C" _declspec(dllexport) int testDelegate(int (*addFunction)(int, int), int a, int b) { int res = addFunction(a, b); return res; } and here is the code in C#: public delegate int AddIntegersDelegate(int number1, int number2); public static int AddIntegers(int a, int b) { return a + b; } ...

jQuery each doesn't have a callback-possibility?

Hello I have a loop created with each, check this example: $('.foo').each(function(i){ //do stuff }); Is there any possibility to run a functions when this loop has ended? Couldn't find it on docs or Google. I can make it work without this kind of solution, but it's always good to search for and use the simpliest methods. Martti ...

Perform function in attr() callback?

Hello, Not sure if I am doing this correctly or not. Here is my JS: var currentIMG; $( '.leftMenuProductButton' ).hover ( function () { currentIMG = $("#swapImg").attr("src"); var swapIMG = $(this).next(".menuPopup").attr("id"); $("#swapImg").css("opacity", 0).attr...

Macro to improve callback registration readability

I'm trying to write a macro to make a specific usage of callbacks in C++ easier. All my callbacks are member functions and will take this as first argument and a second one whose type inherits from a common base class. The usual way to go is: register_callback(boost::bind(&my_class::member_function, this, _1)); I'd love to write: re...