0

I have some JS code that I would like to place in a library and use the functions in it for the creation of my HTML page. I am using Google IDE to build a web app. The only way I can see to create the library is to put the script in a Gdrive file, share the file to all with the fileId, include the web link to the fileID in my header and then reference the functions. However, this doesn't seem to work. I can't find any documents on how to include a library within the IDE (unless it is a library for the server side Apps script). Any suggestions?

My library reference in is:

<script src="https://drive.google.com/file/d/1chj59KuDY8OIKp9F42DYWfbmR9tYLbpm"></script>

I then reference a function in the library:

//test SunCalc library
  let dte = new Date()
  let test = SunCalc.getMoonIllumination(dte)

But I get an:

userCodeAppPanel:10 Uncaught ReferenceError: SunCalc is not defined

Jim Burke
  • 177
  • 10

0 Answers0