Javascript 使用JSFL向现有html文件添加一行新的文本/函数

Javascript 使用JSFL向现有html文件添加一行新的文本/函数,javascript,html,flash-cc,jsfl,Javascript,Html,Flash Cc,Jsfl,我想在现有html文件中添加一些文本/函数行。我可以用FLfile.read()读取文件,这是我的代码: var pathCom=fl.getDocumentDOM().pathURI(); //get complete path var pathWOFile=pathCom.substr(0,pathCom.lastIndexOf('/')); //get the path without file var readFile=FLfile.read(pathWOFile+'/index.h

我想在现有html文件中添加一些文本/函数行。我可以用
FLfile.read()
读取文件,这是我的代码:

var pathCom=fl.getDocumentDOM().pathURI(); //get complete path

var pathWOFile=pathCom.substr(0,pathCom.lastIndexOf('/')); //get the path without file

var readFile=FLfile.read(pathWOFile+'/index.html'); //read the html file

alert(readFile);
我的html文件的结构是:

<html>
  <head>

     <script>
         //i want to add a new function on this line
     </script>

  </head>
  <body>
  </body>
</html>

//我想在这行添加一个新函数
我甚至知道有一个名为
FLfile.write()
的函数将文本附加到文件中,但文本总是添加到结构的最后一行。现在我想在
标签之间添加一些文本函数,我该怎么做呢?对不起,我的英语不好,谢谢你的回复