這是我的頁(yè)面代碼:點(diǎn)擊查看點(diǎn)擊查看點(diǎn)擊查看$(document).ready(function(){$(".showpanel").click(function(){if($("#panel").is(":hidden")){$(this).html("點(diǎn)擊關(guān)閉");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("點(diǎn)擊查看");}});});我點(diǎn)擊“點(diǎn)擊查看”后,“點(diǎn)擊查看”并沒(méi)有改變成“點(diǎn)擊關(guān)閉”,但是調(diào)用console.log($(this).html())在瀏覽器調(diào)試時(shí)是能輸出正確的啊,id為panel的元素也沒(méi)有在頁(yè)面中顯示出來(lái)。。。這咋回事啊。。。各位大俠幫幫忙
jquery無(wú)法改變頁(yè)面內(nèi)容,調(diào)用console.log($(this).html())方法顯示已經(jīng)改變了啊
手掌心
2019-04-09 20:25:51