使用javascript读取文件

Aja*_*jay 0 javascript filehandle

如何使用javascript从服务器端文件中读取内容?

War*_*ung 10

使用Ajax向Web服务器询问它.在jQuery中,例如:

jQuery.get('path/to/file/on/server.txt', null, function(data, status) {
    // your file contents are in 'data'
});
Run Code Online (Sandbox Code Playgroud)