I cant control the function between the outer and inner function.
as I use a top.out1() in the children object. I cannot call the function run
within the $(document).ready(function() { function inner1(){alert("alertinner")}}
the question is:
1.How can I call the function inner() directly by the object children svg page?
2.How can I call the function inner() by the function outer1()?
3.How can I call the function outer2() by the function inner()?
<script type="text/javascript">
function outer1(){
alert("outer1alert");
}
$(document).ready(function() {
function inner(){
alert("inneralert");
}
});
function outer2(){
alert("outer2alert");
}
</script>
It is not particularly clear what you’re asking. If what you mean by “force” a function is to call it, then you can just call the function directly.
For the
outer1()orouter2()functions, you can call them by executingouter1()orouter2()in any context that you want to call them from.inner()is not currently a global functions, but is a local function that is callable from inside the document.ready scope in the same manner by executinginner(). If you want to callinner()from outside that scope, then you need to define it at global scope like this:Then, you can call it from any scope as
inner().