那么要如何才能和后台进行连接呢,我想达到把MySQL数据库的信息在加载的时候显示的效果
window.onload = function(){
waterfall('main','box');
var dataInt = {"data":[{"src":'P_00.jpg'},{"src":'P_01.jpg'},{"src":'P_03.jpg'}]}
window.onscroll = function(){
if(checkScroll()){
var oParent = document.getElementById('main');
for(var i=0;i<dataInt.data.length;i++){
var oBox = document.createElement("div");
oBox.className = "box";
oParent.appendChild(oBox);
var oPic = document.createElement("div");
oPic.className = "pic";
oBox.appendChild(oPic);
var oImg = document.createElement("img");
oImg.src = "images/"+dataInt.data[i].src;
oPic.appendChild(oImg);
}
waterfall('main','box');
}
}
}