CodePudding user response:
If a path is to judge the CSS file exists, (that is, to be able to get a clear file name), can use the following method:$. Ajax ({
Type: "GET",
Url: your url,
Success: the function (result) {
//if the file exists, then enter the success callback
console.log(result);
},
Error: function (result) {
//if the file does not exist, then enter the error callback
The console. The log (result. Status);//404
}
});
If it is to get all the file name of a directory path, suggestion and implementation code with the background,