Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

How to scan a folder for documents with javascript

var dir = "/videos";
var fileextension = ".mp4";
$.ajax({
    //This will retrieve the contents of the folder if the folder is configured as 'browsable'
    url: dir,
    success: function (data) {
        // List all mp4 file names in the page
        $(data).find("a:contains(" + fileextension + ")").each(function () {
            var filename = this.href.replace(window.location.host, "").replace("http:///", "");
            $("body").append($("<img src=" + dir + filename + "></img>"));
        });
    }
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: react icons cdn 
Javascript :: vue date helper 
Javascript :: send message to user facebook game 
Javascript :: comment faire pour écrire un texte en javascript 
Javascript :: how to use of socket io on a route in nodejs 
Javascript :: angular size of array 
Javascript :: remove all white spaces and different characters globally 
Javascript :: fabric js 
Javascript :: regex city and state 
Javascript :: Replace empty strings in object with null values 
Javascript :: dividing a number into digits javascript 
Javascript :: confirm closing tab 
Javascript :: js create and call function 
Javascript :: get selected option from select javascript 
Javascript :: javascript null Conversion to Number 
Javascript :: launch json for golang with args 
Javascript :: string date to date in javascript 
Javascript :: javascript check type of variable var 
Javascript :: Material-ui cold icon 
Javascript :: javascript ean13 checksum generate 
Javascript :: edit json text react 
Javascript :: expected an identifier and instead saw const 
Javascript :: run another process on nodejs process exit 
Javascript :: get date in format 
Javascript :: Hide ReactTooltip after hover off 
Javascript :: node start is too slow windows 10 
Javascript :: selected option using javascript 
Javascript :: remove the last character from a string in JavaScript, 
Javascript :: angular cli spec test false 
Javascript :: show filed of object javascript 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =