这是我的页面代码:
点击查看
点击查看
点击查看
$(document).ready(function() {
$(".showpanel").click(function(){
if($("#panel").is(":hidden")){
$(this).html("点击关闭");
innerobj=$.ajax({url:"MyServlet"+"?itemId="+$(this).attr("title"),async:false});
$("#panel").html(""
+"
"
"
+innerobj.responseText
+"
+"<>"
+""
+"
$("#panel").show();
console.log($(this).attr("title"));
}
if($("#panel").is(":visible")){
$("#panel").hide();
$(this).html("点击查看");
}
});
});
我点击“点击查看”后,“点击查看”并没有改变成“点击关闭”,但是调用console.log($(this).html())在浏览器调试时是能输出正确的啊,id为panel的元素也没有在页面中显示出来。。。这咋回事啊。。。各位大侠帮帮忙