javascript - Convert function result to variable -
i stuck many hours now. please me following:
i output following code variable:
window.plugins.text.translate("word", function(result) { return result; } (function(cordova) { function device() {} device.prototype.translate = function(key, callback) { cordova.exec( callback, callback, "localizable", "get", [key]); } if (!window.plugins) window.plugins = {} window.plugins.text = new device() })(window.cordova || window.cordova || window.phonegap); i tried several things, this:
function translate(){ var test = ""; var r = window.plugins.text.translate("paid", function(result) { test = result; }); return test; } this gave me alert, without content. hoping guys me.
Comments
Post a Comment