$(document).ready(function() {
$("#img-1").click(function() {
switch (true) {
case $("#div2").load("borrower-information.html"):
alert(hello);
break;
case ($("#div3").load("demo_test.html #p3")):
break;
case ($("#div4").load("demo_test.html #p4")):
alert('hello');
}
});
});
球員我做了3格,有一個按鈕的id名稱是id = img-1點擊從其他來源的頁面加載後,其確定,但我的查詢是,該警報不是工作爲什麼?jquery case語句不起作用
你期待這個開關做什麼? 「開關(真)」聽起來有點奇怪。 – putvande
jQuery沒有'case'語句。 * JavaScript *確實如此。 –
'switch(true)'總是'true/1'。 –