Aaron McAdam
Aaron McAdam

Reputation: 706

Passing an argument into a function as a parameter of a function call

This is probably more of a JavaScript question but I'd like to pass another parameter in the getPicture_Success function argument here:

navigator.camera.getPicture(getPicture_Success, null, options);

The getPicture_Success function's signature is getPicture_Success(imageData).

I'm trying to do 2 different things depending on where in the app the photo is needed - rendering the image on a different screen for each.

I'd like to pass another argument into it, like getPicture_Success(imageData, appScreen), for example.

Upvotes: 0

Views: 653

Answers (1)

Björn
Björn

Reputation: 29381

navigator.camera.getPicture(function(imageData) {
    getPicture_Success(imageData, 'Screen 1');
}, null, options);

Upvotes: 5

Related Questions