$.ajax({
url: 'http://' + window.location.host + '/',
success: function(data){
$(data).find("a:contains(.jpg)").each(function(){
var images = $(this).attr("href");
$('<p></p>').html(images).appendTo('a div of your choice')
});
}
});
I could not find a way to do the same in javascript, I can make an ajax call like this
request = new XMLHttpRequest();
request.open('GET', 'http://' + window.location.host + '/', true);
request.onload = function(files) {
if (request.status >= 200 && request.status < 400){
resp = request.responseText;
} else {
}
};
request.onerror = function() {
};
but how do I get a list of files in a directory?
CSJS and / or SSJS are both responses in order. My main goal is not to use jQuery to accomplish what I want.
source
share