Can I change the context of javascript "this"? -


  var यूआई $ अनुबंध $ ddlForm_change = function () {// 'यह' वर्तमान में ड्रॉप डाउन है कि आग इवेंट // मेरा प्रश्न यह है कि मैं संदर्भ को बदल सकता हूं, इसलिए "यह" किसी अन्य वस्तु का प्रतिनिधित्व करता है? यह = कुछ ऑब्जेक्ट; // फिर नए "यह" this.someMethod (someParam) पर तरीकों को कॉल करें; };  

क्या यह संभव है? धन्यवाद, ~ सैन डिएगो में सीके

नहीं, यह संभव नहीं है।

आप यह ( method.apply () / method.call () का उपयोग करके एक विधि को कॉल कर सकते हैं ) लेकिन आप कीवर्ड, यह । पुनः नहीं दे सकते हैं।


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -