首页 > 解决方案 > 功能在 Chrome 中运行良好,但在 Firefox 中不起作用

问题描述

朋友们,我的功能在 Chrome 中运行良好,但在 Firefox 中无法运行并给出错误:Uncaught TypeError: Property 'handleEvent' is not callable.

我的功能:function test(){ var a12= parseInt(document.querySelector("#number").value);var a13 = a12.toLocaleString(); SendOrderApi.setOrderCount(a13);}

这个错误的原因是什么?我该如何解决这个问题?

function test(){ 
  var a2= parseInt(document.querySelector("#number").value);
  var a3 = a2.toLocaleString(); 
  document.getElementById("s01").innerText=a3;
}
<input id="number" type="number" onmousewheel="test()">
<br>
<span id="s01">12</span>

标签: javascriptfunction

解决方案


mousewheel 不是标准处理程序标准wheel是:

function test(){ 
  var a2= parseInt(document.querySelector("#number").value);
  var a3 = a2.toLocaleString(); 
  document.getElementById("s01").innerText=a3;
}
<input id="number" type="number" onwheel="test()">
<br>
<span id="s01">12</span>


推荐阅读