-1
CODE:?任何人都知道什么是替代这段代码在IE浏览器。它工作在Firefox,铬(=()=>)
<script>
var expectedFunc =() => showAllSteps();
function showAllSteps() {
alert('showAllSteps');
expectedFunc =() => nextStep();
}
function nextStep() {
alert('nextStep');
expectedFunc =() => showAllSteps();
}
function toggleFunction() {
expectedFunc();
}
</script>
<button type="button" class="btn" name="showAllBtn" onclick="toggleFunction()">Show all</button>
在此代码expectedFunc =()= > showAllSteps(); =()=>在IE中不起作用。有人知道什么是IE中这个切换的替换吗?
'expectedFunc = showAllSteps;' - 你只是定义其只是调用一个函数的函数;你可能只是重新分配原来的功能。 – deceze