JQuery没有';使用AJAX加载内容时无法工作
我在使用AJAX加载页面时遇到了一个问题。我使用jquery创建了一个pinterest类型的排列 但是,当我使用Ajax加载它时,它不起作用JQuery没有';使用AJAX加载内容时无法工作,jquery,pinterest,Jquery,Pinterest,我在使用AJAX加载页面时遇到了一个问题。我使用jquery创建了一个pinterest类型的排列 但是,当我使用Ajax加载它时,它不起作用 我已经搜索了它并找到了bind()函数。但是如何在JQuery中与.css一起使用它。搜索后的结果并不令人满意。请像这样更改您的函数 function indmoreclik(a,b) { if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera,
我已经搜索了它并找到了bind()函数。但是如何在JQuery中与.css一起使用它。搜索后的结果并不令人满意。请像这样更改您的函数
function indmoreclik(a,b)
{
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("more").innerHTML=xmlhttp.responseText;
var t1=0;
var t2=0;
var t3=0;
for(j=1;j<=20;j++)
{
$('.div1:nth-child('+j+')').css({ top:''+t1+'px',left:'250px'});
height=$('.div1:nth-child('+j+')').outerHeight(true);
t1=t1+height;
$('.div2:nth-child('+j+')').css({ top:''+t2+'px',left:'520px'});
height=$('.div2:nth-child('+j+')').outerHeight(true);
t2=t2+height;
$('.div3:nth-child('+j+')').css({ top:''+t3+'px',left:'790px'});
height=$('.div3:nth-child('+j+')').outerHeight(true);
t3=t3+height;
}
}
xmlhttp.open("GET","tap2.php?tun="+a+"&inc="+b,true);
xmlhttp.send();
函数indmoreclik(a,b)
{
if(window.XMLHttpRequest)
{//IE7+、Firefox、Chrome、Opera、Safari的代码
xmlhttp=新的XMLHttpRequest();
}
其他的
{//IE6、IE5的代码
xmlhttp=新的ActiveXObject(“Microsoft.xmlhttp”);
}
xmlhttp.onreadystatechange=函数()
{
if(xmlhttp.readyState==4&&xmlhttp.status==200)
{
document.getElementById(“更多”).innerHTML=xmlhttp.responseText;
var t1=0;
var t2=0;
var t3=0;
对于(j=1;jTry)调用函数,您在ajax请求后在ajax页面中被调用。我可以使用bind jquery函数吗?请帮助您粘贴ajax cal的代码吗?在ajax请求完成后,在document ready中发布jquery代码您正在使用的所有函数