它必须是 jquery
我在 (a,b,c,d,e,f) 中有 6 个 div 的文件 text.html
在另一个文件中,我有一个 div,我喜欢将 a+b+c+d+e+f 的内容填充到该单个 div 中
我尝试过 .load = 但 b remplace a 我尝试过追加,但我需要一个临时变量
所以现在我被困住了
该代码从文件 textes.html ... div #a 中获取内容并将内容放入 div #right,但第二个 libe 将右 a 的内容替换为右 b
我喜欢在 b 上附加内容 a + b 而不是 a
$(document).ready(function(){
var temp = load('textes.html #nicolas');
$('#right').append(temp);
var temp = load('textes.html #antoine');
$('#right').append(temp);
.
.
.
.
return false;
});
该代码是应该工作的想法,但我不能制作一个ajax .load()来将内容加载到一个变量中以将内容附加到div ...
<script type="text/javascript">
$(document).ready(function(){
$.ajax({
url: "textes.html",
cache: false,
success: function(html){
$("#right").append(html);
}
});
});
</script>
该代码加载整个 html 文件,我喜欢只获取一些选定的 DIV #