don*_*onk 3 javascript reflection scope
所以我想知道是否可以从范围外访问变量(具有函数值).我有这样的代码:
function parentFunction(){
var childFunction = function() {
// do something
}
}
$(function(){
// need to access childFunction() here.
});
Run Code Online (Sandbox Code Playgroud)
var childFunction;
function parentFunction(){
childFunction = function() {
// do something
}
}
$(function(){
childFunction();
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
251 次 |
| 最近记录: |