将参数传递给函数作为函数调用的参数 [英] Passing an argument into a function as a parameter of a function call

查看:182
本文介绍了将参数传递给函数作为函数调用的参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能是一个JavaScript问题,但我想在getPicture_Success函数参数中传递另一个参数:

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);

getPicture_Success函数的签名是getPicture_Success(imageData)。

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.

推荐答案

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

这篇关于将参数传递给函数作为函数调用的参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆