简体   繁体   English

单击 select2 下拉菜单时获取更改框消息

[英]Getting alter box message when clicking on select2 dropdown

I have added a simple select2 plugin for drop down but when i am clicking on it it is generating an alert box and saying "localhost:8080 says 1".我已经为下拉添加了一个简单的 select2 插件,但是当我点击它时,它会生成一个警告框并显示“localhost:8080 says 1”。 It is too irritating as it is creating an obstacle for the click event.这太烦人了,因为它为点击事件制造了障碍。 If you ever faced anything like that and solved the issue please help me out.如果您曾经遇到过类似的事情并解决了问题,请帮助我。 Thank you谢谢

html code - HTML 代码 -

<select class="form-control collections-select2" id="categoryNameInput">
                            <option></option>
                                <c:if test='${not empty categoryName}'>
                                    <option selected>${categoryName}</option>
                                </c:if>
                            </select>

I finally found a way to disable the alert that was happening on the click event.我终于找到了一种方法来禁用发生在点击事件上的警报。 I simply disable the alert from that page.我只是从该页面禁用警报。

window.alert = function() {};

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM