Using a local file as a data source in JavaScript

前端 未结 6 946
星月不相逢
星月不相逢 2020-12-12 17:36

Background:

I want to make an \"app\" that uses JavaScript/HTML only and can be opened by a browser directly from the filesystem. This app

6条回答
  •  天涯浪人
    2020-12-12 18:03

    Ensuring that the file is in the same directory or in a sub directory, load the file with AJAX.

    Unlike a script tag, you will get access to the contents.

提交回复
热议问题