jQuery load something based on whose class is “active”
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm trying to use this with tabs that load content with ajax into a div. I can't get it to refresh on the interval. The top part does work, however. <script type = "text/javascript" > $ ( function rlAl () { if ( $ ( "#xicon1" ). hasClass ( "active" )) { $ ( "#actionlist" ). load ( "alcurrent.php" ); } else if ( $ ( "#xicon2" ). hasClass ( "active" )) { alert ( "icon2" ); } else if ( $ ( "#xicon3" ). hasClass ( "active" )) { alert ( "icon3" ); } }); $ ( function () { setInterval ( rlAl , 5000 ); }); </script> 回答1: rlAl is undefined