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

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -