Reading Server Side file with Javascript

前端 未结 2 1552
轮回少年
轮回少年 2020-12-15 23:32

Does anyone know of a tutorial on how to read data from a server side file with JS? I cant seem to find any topics on this when I google it. I tried to use but it does not s

2条回答
  •  旧巷少年郎
    2020-12-16 00:32

    To achieve this, you would have to retrieve the file from the server using a method called AJAX.

    I'd look into JavaScript libraries such as Mootools and jQuery. They make AJAX very simple use.

    
        
            
            
        
        
            
        
    
    

    If you upload that to the directory that test.csv resides in on your webserver and load the page, you should see the contents of test.csv appear in the textarea defined.

提交回复
热议问题