AJAX reading from file

前端 未结 2 1551
余生分开走
余生分开走 2021-01-16 14:38

I\'m reading from a text file using AJAX. How do I read only the first line?

2条回答
  •  独厮守ぢ
    2021-01-16 14:55

    It depends on how you output the file on the back-end. Depending on a language, be it PHP, Java or other, you can read the first line of your file and output it to the response.

    To find out whether a file has changed: HTTP code 304 and browser-side caching may help in this case.

提交回复
热议问题