jQuery Autocomplete中超出了最大呼叫堆栈

发布于 2025-01-19 02:10:08 字数 394 浏览 2 评论 0原文

如果我在jQuery AutoComplete内使用了focus()方法,那么我将在jQuery Autocomplete中面临问题,然后将Maxim呼叫堆栈超过了,有时候我也无法清楚地清楚输入类型中输入的内容。我的代码看起来好像

onSelect: function (output) {   
  $("#studentID").val(output.data);    
  $('#StudentName').focus(); 
},

我要评论focus()方法,那么不会发生错误,我对此字段进行了验证,即

如果我评论focus()方法,则仅通过focus() 方法删除验证发生了,我对该领域的验证是,仅通过focus()方法

最大调用堆栈错误才能删除验证,这是我唯一关心的

I'm facing the problem in jQuery autocomplete if I used focus() method inside my jQuery autocomplete then it throws maxim call stack exceeded and sometime I couldn't clear what I'm typed in the input type also. my code looks like

onSelect: function (output) {   
  $("#studentID").val(output.data);    
  $('#StudentName').focus(); 
},

If I comment the focus() method then there is no errors will happen, I have the validation of this field that validation only removed by focus() method

If I comment the focus() method then there is no errors will happen, I have the validation of this field that validation only removed by focus() method

Maximum call stack error could not be thrown thats my only concern

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

写给空气的情书 2025-01-26 02:10:08

尝试一下 - 永远不要集中可能引发重点的东西

onSelect: function (output) {   
  $("#studentID").val(output.data);    
  setTimeout(() => $('#StudentName').focus(),10); 
},

Try this - never focus something that may trigger something on focus

onSelect: function (output) {   
  $("#studentID").val(output.data);    
  setTimeout(() => $('#StudentName').focus(),10); 
},
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文