Load a file automatically without using a click button

前端 未结 4 1845
走了就别回头了
走了就别回头了 2021-01-16 07:15

I am new to javascript and want to load the file without having to click on the load file button

I am using the following script and I want the text to be loaded aut

4条回答
  •  情书的邮戳
    2021-01-16 07:45

    Respond to the document's ready event:

    $(document).ready( loadFileAsText );
    

    If you don't want to use jQuery for simple compatibility with multiple browsers, then see this answer: pure JavaScript equivalent to jQuery's $.ready() how to call a function when the page/dom is ready for it

提交回复
热议问题