R
R
Rinsewind2015-05-19 09:59:43
JavaScript
Rinsewind, 2015-05-19 09:59:43

How to execute code in the context of an anonymous function?

Good afternoon!
The js file is connected to the page, containing the following code:

(function(a) {
 function first(b) { 
 }
 funciton second(c) {
 a.onkeydown = function(d) { first(2); }
 }
})(window);

How can a script access the contents of an anonymous function? /*For example, execute first(4);*/ Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Zhak, 2015-05-19
@romanzhak

window['first'] = function(){};

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question