javascript - Calling a function by name that is not part of the global scope -


मान लें कि मेरे पास ऐसा कुछ है:

  var MyApp = MyApp || {}; MyApp.feature = (फ़ंक्शन ($) {var somelocalVariable, अन्य init = function () {}, somePrivateFunction = function () {var functionName = 'otherFunction'; // मैं नाम से अन्य फ़ंक्शन कैसे कॉल कर सकता हूँ (ऊपर चर का उपयोग करके)} , अन्य फंक्शन = फ़ंक्शन () {}; वापसी {init: init}}) (jQuery);   

इस उदाहरण में अगर मैं खिड़की [अन्य फ़ंक्शन] करता हूँ कुछ भी नहीं होगा क्योंकि यह वैश्विक फ़ंक्शन नहीं है। मैं इसे अधिक निजी क्षेत्र के एक भाग के रूप में कैसे निष्पादित कर सकता हूं?

"विंडो" को "यह" के साथ बदलें " <पूर्व> यह [functionName] ();

Comments

Popular posts from this blog

Delphi: missing interface declarations for UI Automation methods -

android - How to attach an image from an app to gmail -

php - how to change mysql_result($res, 0, "url"); to mysqli -