如题,只在IE上出现这样的问题。
代码:$(document).ready(function(){
$(".fenye").click(function(){
var page = $.trim($(this).text());
var numbpg = $("#numberPage").val();
if(page=="下一页"){
$("#numberPage").val(parseInt(numbpg)+1);
}else if(page=="上一页"){
$("#numberPage").val(parseInt(numbpg)-1);
}else{
$("#numberPage").val(page);
}
$("#formT").submit();
});
$(".adelete").click(function(){
var tid=$(this).parent().parent().children("input").val();
if(tid != null && parseInt(tid) >0 ){
var flag = confirm("温情提示:您确定要删除吗?");
if(flag){
window.location.href=getRootPath()+"/term/term_deletermAction?tid="+tid;
}
}
}); $(".admin_div").bind("mouseleave", function(){
$(this).children("div").children("div").hide();
});
$(".admin_div").bind("mouseenter", function(){
$(this).children("div").children("div").show();
});
$("#button").click(function(){
$("#numberPage").val(1);
$("#formT").submit();
});
});
有时候无效,里面给控件注册的方法都没来路,郁闷呀。在情况也是偶然的,有时候有是好的。这叫我怎么弄- -。。表示鸭梨好大
代码:$(document).ready(function(){
$(".fenye").click(function(){
var page = $.trim($(this).text());
var numbpg = $("#numberPage").val();
if(page=="下一页"){
$("#numberPage").val(parseInt(numbpg)+1);
}else if(page=="上一页"){
$("#numberPage").val(parseInt(numbpg)-1);
}else{
$("#numberPage").val(page);
}
$("#formT").submit();
});
$(".adelete").click(function(){
var tid=$(this).parent().parent().children("input").val();
if(tid != null && parseInt(tid) >0 ){
var flag = confirm("温情提示:您确定要删除吗?");
if(flag){
window.location.href=getRootPath()+"/term/term_deletermAction?tid="+tid;
}
}
}); $(".admin_div").bind("mouseleave", function(){
$(this).children("div").children("div").hide();
});
$(".admin_div").bind("mouseenter", function(){
$(this).children("div").children("div").show();
});
$("#button").click(function(){
$("#numberPage").val(1);
$("#formT").submit();
});
});
有时候无效,里面给控件注册的方法都没来路,郁闷呀。在情况也是偶然的,有时候有是好的。这叫我怎么弄- -。。表示鸭梨好大
alert("aaa");
}
如果我在里面加个alert("aaa");,它会执行,表示他进来了,但是
$(".admin_div").bind("mouseleave", function(){
$(this).children("div").children("div").hide();
});这个东西就无效。
情况是偶然的- -,,,
像这种$(".admin_div"),有没有可能因为一条记录都没有而获取不到对象,那种情况你调bind方法可能会出错,而非ie浏览器可以忽略掉错误让页面看起来正常你试试把bind改为live试试
$("#formT").submit();$(document).ready(function(){
$(".fenye").click(function(){
var page = $.trim($(this).text());
var numbpg = $("#numberPage").val();
if(page=="下一页"){
$("#numberPage").val(parseInt(numbpg)+1);
}else if(page=="上一页"){
$("#numberPage").val(parseInt(numbpg)-1);
}else{
$("#numberPage").val(page);
}
$("#formT").submit();
});
加个 setTimeout可以解决 无数类似问题