就是同步写的。完整过程如下:
index.html 中通过jquery load内一个html片段menu.html
index.html 代码如下:
<html>
<body>
<div id="aa"></div>
<script src="jquery.js"></script>
<script>
$(document).ready(function(){
$('#aa').load("menu.html"); // menu.html中有.menu_item元素
// 失效 无弹出框
$(".menu_item").each(function(){
alert($(this).text());
});
});
</script>
</body>
</html>
【 在 shaolin 的大作中提到: 】
: load is sync ?
--
FROM 119.184.121.*