callback

Nil Reference when Update

I am trying to get Paperclip working with MiniExiftool. I finally wrote this: # Photo model belongs_to :user has_attached_file :picture after_picture_post_process :copy_exif_data private def copy_exif_data exif = MiniExiftool.new picture.queued_for_write[:original].path self.date = exif['date_time_original'] ...

How do I detect if a request is a callback in the Global.asax?

I need to find a way to detect if a request is a callback when the Application_BeginRequest method is called.     Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)        Dim _isCallBack As Boolean = False          [Code to set _isCallBack is True or False Here]          If Not _isCallBack Then           ... So...

call a function named in a string variable in c

Hello everybody, I want to call a function using a variable.Is it possible in C?? Actually, what I want to do is, get the function name from the user and store it in a variable say var. Now I want to call the function that has its name stored in the variable var. Can anyone tell me how this can be done in C? Actually I want to develop ...

can the callback from GetLocations() (from the Google Maps API) call anything other than API functions?

I'm working in Javascript on a Maps API project for work. I'm having trouble with the callback function which I pass to GetLocations in which it has to call another chunk of code (all the callback does is store the lat and lng into an object). But after the function does its work, the next function doesn't get called. How does this call...

Jeditable CANCEL callback from AJAX callback?

Hello, I see some answers for the Jeditable plugin to use a callback function from AJAX using complete callback function. I know that the Jeditable has a callback function for the SUBMIT button, so I would like to know if there is a way to have a callback for the CANCEL button? I haven't found on the plugin docs. Thanks for reply, Ca...

C# creating callbacks playback finished.

Hello, C# 2008 SP1 I am using the following code to record, play, and stop save the recording. Everything works fine. However, I would like to add a call back that will fire when the playback has finished. I am P/Invoke using the winmm.dll library. Many thanks for any advice. public partial class SoundTest : Form { const...

C++ Functors and Zero

Hello all: First a disclaimer, I am replacing a bunch of code which uses boost::function and boost::bind. However, I am moving to a codebase which does not allow rtti. I would like to keep using boost but don't know if there is a way around this restriction. So..., I am trying to mimic some of its functionality, but much more simplif...

How to have a javascript callback executed after an update panel postback?

I'm using a jQuery tip plugin to show help tips when the user hovers certain elements of the page. I need to register the plugin events after the page is loaded using css selectors. The problem is I'm using an ASP.NET Update Panel and after the first postback, the tips stop working because the update panel replaces the page content but...

Is there a way to get upload progress using the HttpPostedFile class?

I want to use the HttpPostedFile Class to upload one or more large files to an ASP.NET MVC controller from a web page. Using this class, uploaded files larger than 256 KB are buffered to disk, rather than held in server memory. My understanding is that it can be done like this: if (context.Request.Files.Count > 0) { string tempFi...

Don't submit form if nothing selected, using jQuery ajaxForm plugin

I'm using the jQuery Form plugin to do an 'ajax' submit of my form, which consists of about 4 radio selects. However, I want the form to not submit if none of the radio buttons have been selected. Here's my attempt so far, helped by so code I've found in another SO answer and the plugin docs: $(document).ready(function() { var option...

callback when method finished

I want to execute method: bar() when method foo() is done. This could be done like this: function foo() { //.... bar(); } But there is surely some way to execute bar() like a callback to foo()? I have been looking in prototype API, but so far I only found ways to bind callbacks to HTML-elements... ...

Tomcat Comets application returns .jsp page instead of weather data

I have implemented the Comets tutorial at http://www.ibm.com/developerworks/web/library/wa-cometjava/#N100CC It seems like I am getting data returned from the server using the Comets technique - i.e. being pushed to the browser. However I am getting the .jsp page that I use to trigger the Comet event returned, rather than the weather da...

Return JSON wrapped in a callback function from a WCF REST web service

I have a web service returning JSON, but now I'd like to modify it to allow callers to specify a callback function so the return goes from: JSON DATA to specifiedFunction(JSON DATA); The way I'm returning JSON right now is just by returning an instance of an object and having .NET do its serialization magic, if I change to just returning...

jquery ajax callback function without dynamic parameters

Hi everyone, I have an array with objects, I want to save each one of them via GET, and update certain params in the callback, bot the html: <html><body><div id='test'><div id="a">a</div><div id="b">b</div></div></body></html> the js: $.map($("#test > div"), save) save = function(o,i){ itt = $(o) tmp = {'desc':itt.html()}; $.ge...

How can I pass a parameter to a setTimeout() callback?

I have some JavaScript code that looks like: function statechangedPostQuestion() { //alert("statechangedPostQuestion"); if (xmlhttp.readyState==4) { var topicId = xmlhttp.responseText; setTimeout("postinsql(topicId)",4000); } } function postinsql(topicId) { //alert(topicId); } I get a error that topicId is not defin...

jQuery / Ajax - $.ajax() Passing Parameters to Callback - Good Pattern to Use?

JavaScript code I'm starting with: function doSomething(url) { $.ajax({ type: "GET", url: url, dataType: "xml", success: rssToTarget }); } Pattern I would like to use: //where elem is the target that should receive new items via DOM (appendChild) function doSomething(url, elem) { ...

jquery understanding $('#name').load(...)

Hi all, I'm having some trouble understanding how to accomplish the following: Basically, I'm just delving into the world of Ajax, and I have built a simple application to practice on. My current problem is that I want to have a form dynamically added below "add entry", so that people don't have to go off to another page to update the p...

Order of evaluation in JavaScript code using Ajax

It seems (to me) like javascript statements do not always run one after another. I know they do that way but sometimes it seems like a show() func tion fires at the same time with hide() so the logic fails. There are callback functions to use, like jQuery.load("some.html",thenrunthis) .. I need to understand the working logic. any help/...

jquery load callback fails

I have this code. function loadBottom(dockitemid) { var itemno = dockitemid.substring(3,4); var adres = pages[itemno - 1]; $("#BottomLoader").fadeIn(300); $("#Bottom").load(adres,function(){$("#BottomLoader").fadeOut(800);}); } The problem is it only works for the first time. Once the #Bottom div is loaded with some ...

Can I use WCF duplex binding to relay message?

I have a Client Application, a server and another client, lets call it third party. I have a callback interface as part of my contract that is implemented both by the third party and the client. The third party will call a server operation(method) then the server will trigger a callback but instead of calling the callback of the third ...