javascript – 组合框在警报即将到来时消失

在我的jsp页面中,我有一个文本框和两个组合框.当我在文本框中写东西时,我的jsp页面中会出现警报.警报即将出现,因为“用户名已经存在”,并且警告文本框自动刷新但两个组合框消失了为什么?我无法找出可能有什么帮助的原因吗?我在头部包括以下内容.警报的完整来源是here.

http://csscody.com/demo/wp-content/demo/popup/js/jquery.easing.1.3.js

http://csscody.com/demo/wp-content/demo/popup/js/alertbox.js

http://csscody.com/demo/wp-content/demo/popup/js/style.css

<html>
<head>
    <Meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>JSP Page</title>
    <SCRIPT type="text/javascript" src="js/jquery.min.js"></SCRIPT>
<SCRIPT type="text/javascript" src="js/jquery.easing.1.3.js"></SCRIPT>
<SCRIPT type="text/javascript" src="js/alertBox.js"></SCRIPT>
<LINK rel="stylesheet" type="text/css" media="all" href="js/style.css">

    <script type="text/javascript">
          $(document).ready(function() {
           $("#textBox").keyup(function () {
    $.getJSON('check.jsp', {
        textBoxname: this.value
    },function(data){
      if(data.isTrue){
          $("#textBox").val(''); //clear the text Box
          csscody.alert("username already exists");// here alert is coming
                 }
      else{
      }
     });
});
});
    </script>
 </head>
<body>
        <input type="text" id="textBox" name="textBoxname" style="position: absolute; width: 250px; left: 110px; top: 40px;" />
<br/><br/>

// The following two combo Boxes are getting vanished after alert why
<select id="" name="" style="position: absolute; left: 600px; top: 40px; width: 250px;">
     <option value=""></option>
      <option value="somedata">somedata</option>
          </select>
<br/><br/> 
<select id="" >
    <option value="_"></option>
     <option value="somedata">somedata</option>
        </select>
 </body>
</html>

check.jsp

JSONObject jsonObj= new JSONObject(); 
jsonObj.put("isTrue","true");
response.setContentType("application/json");
response.getWriter().write(jsonObj.toString());

解决方法:

你的代码都可以.当我开始调试代码时,我在alertBox.js中看到了一些有趣的东西:(第141和178行)

  if (!$.support.maxHeight) { //IE6
              $('embed, object, select').css({ 'visibility' : 'hidden' });
  }

代码检测ie6(如果读取评论),但似乎是它的错误.

只需注释这些行,您的问题就会得到解决.

并且不要忘记发布此错误
祝好运.并开始使用调试器:)

相关文章

页面搜索关键词突出 // 页面搜索关键词突出 $(function () {...
jQuery实时显示日期、时间 html: &lt;span id=&quot...
jQuery 添加水印 &lt;script src=&quot;../../../.....
中文:Sys.WebForms.PageRequestManagerParserErrorExceptio...
1. 用Response.Write方法 代码如下: Response.Write(&q...
Jquery实现按钮点击遮罩加载,处理完后恢复 思路: 1.点击按...