当我调用JavaScript中的其他一些函数时,我想在jQuery中执行一些任务。
解释这个问题:我们说我在JavaScript中有function foo(){..}
。
虽然我的代码处于执行阶段,但我想在调用function foo(){..}
时使用jQuery执行一些操作。
粗略演示:
<!DOCTYPE html>
<title>Demo</title>
<body>
<script>
function foo()
{
alert("Function Called");
}
...Some code....
if(some condition)
foo(); //function Call - I want to execute jQuery event when this line is executed.
else
woo();
</script>
</body>
</html>
是否有可以实现此目的的事件处理程序?