Ajax 代码如下
function countFolder(){
var dir='albums';
var count=0;
alert(dir);
$.ajax({
url: dir,
async:false,
success: function (data) {
$(data).find("a:contains(" + 'album' + ")").each(function () {// function to read foldera name contains 'album'
count++;
//alert(url);
});
}
});
return count;
}
纯javascript有没有等价的代码?