0

I have made a sidnav for this webapp and used the method to have it on Multiple pages. Everything is loading correctly except for the ScriptApp.getService().getUrl(). Instead of getting the URL, it is just returning it as text

enter image description here

Instead of this enter image description here

The code for the links

<li><a href="<?= ScriptApp.getService().getUrl(); ?>?v=salespipe">Sales Pipeline</a></li>
<li><a href="<?= ScriptApp.getService().getUrl(); ?>?v=projects">Projects</a></li>

Is there something really straightforward that I am doing wrong? It would really save a lot of time if I could use the include code instead of updating each page manually

Ehsan HP
  • 456
  • 2
  • 5
  • 16

1 Answers1

0

If your goal is to insert an Apps Script/Javascript code into your HTML, try the following:

<li><a href="javascript:ScriptApp.getService().getUrl();?v=salespipe">Sales Pipeline</a></li>
<li><a href="javascript:ScriptApp.getService().getUrl();?v=projects">Projects</a></li>
Jacques-Guzel Heron
  • 2,480
  • 1
  • 7
  • 16
  • Hey Mate, thanks for giving that suggestion. Unfortunately, that did not work either. Only way I can get it to work is if it is in the main HTML file, I think it is just something AppsScript does and I'll just have to put up with it lol – YouthfulSpaghetti Nov 17 '22 at 22:26