~Onlooker 2011-02-11 08:03 采纳率: 0%
浏览 36

IE的jQuery问题

i am having problems with Jquery in IE, the code is not working, can any one help me.

http://efm.net.au/component/content/article/54

please check this in IE and FF (or opera, safari, chrome) and select state, and you will see that clubs get loaded but do not show up in IE, but they show up in FF.

Please help its kind of urgent. thanks

    function loadClub()
{




  var st = document.getElementById("State").value;

  if(st != "Select State")
  {
    jQuery("#loaderBox").css("display","block");
//alert(document.getElementById("Club").innerHTML);
//alert($("#State").val());
/*$("div#Club_container").remove();*/

setTimeout('jQuery(".club-drop input").remove();',100);
setTimeout('jQuery("#Club_container").remove();',100);


if (window.XMLHttpRequest)

  {// code for IE7+, Firefox, Chrome, Opera, Safari

  xmlhttp=new XMLHttpRequest();

  }

else

  {// code for IE6, IE5

  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

  }

xmlhttp.onreadystatechange=function()

  {

  if (xmlhttp.readyState==4 && xmlhttp.status==200)

  {/*
$(".state-drop input#State_input").remove();
$("div#State_container").remove();
$(".club-drop input#Club_input").remove();
$("div#Club_container").remove();*/
//setTimeout('$(".state-drop").remove()',500);

if(jQuery("#club1").length > 0)
{

  document.getElementById("club1").innerHTML=xmlhttp.responseText;
   document.getElementById("club2").innerHTML=xmlhttp.responseText;
    document.getElementById("club3").innerHTML=xmlhttp.responseText;

}else{
    document.getElementById("Club").innerHTML=xmlhttp.responseText;


}
//jQuery("div.state-drop").css("border","none");
jQuery("div.state-drop span").css("display","none");
     jQuery('.efm-text input[type="submit"]').removeAttr('disabled');


    if(jQuery("#club1").length > 0)
{
setTimeout("jQuery('#club1').selectbox()",100);
setTimeout("jQuery('#club2').selectbox()",100);
setTimeout("jQuery('#club3').selectbox()",100);

}else{
setTimeout("jQuery('#Club').selectbox()",100);
    //jQuery('#Club').selectbox();
}

jQuery("#loaderBox").css("display","none");

    }

  }





xmlhttp.open("GET","/club/state-club.php?state="+st,true);

xmlhttp.send();


    }else{
      setTimeout('jQuery(".club-drop input").remove();',100); 
      //jQuery("div.state-drop").css("border","1px solid red");
      jQuery("div.state-drop span").css("display","block");
      jQuery("div.state-drop span").css("color","red");

      jQuery('.efm-text input[type=submit]').attr('disabled', 'disabled'); 
        if(jQuery("#club1").length > 0)
        {

         document.getElementById("club1").innerHTML="Select State First";
   document.getElementById("club2").innerHTML="Select State First";
    document.getElementById("club3").innerHTML="Select State First";

    setTimeout("jQuery('#club1').selectbox()",100);
setTimeout("jQuery('#club2').selectbox()",100);
setTimeout("jQuery('#club3').selectbox()",100);

        }else{
       document.getElementById("Club").innerHTML="Select State First";
    setTimeout("jQuery('#Club').selectbox()",100);
        }

    }


}
  • 写回答

1条回答 默认 最新

  • 北城已荒凉 2011-02-11 10:05
    关注

    1 - Upgrade to the latest version of jQuery. I have never faced any cross browser issues with jQUery.

    2 - Replace your ajax code with jQuery code.

    E.g -

         $.post("/someapp/login.do",$("#loginForm").serialize(), function(data) {
                        // Callback code
            $('#loginDiv').html(data);
        });     
    
    评论

报告相同问题?

悬赏问题

  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
  • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序
  • ¥15 onvif+openssl,vs2022编译openssl64