Mask
Mask

Reputation: 573

How to navigate between google.script

I have created a dashboard with navigation using JavaScript.

However, I am unable to toggle between different HTML created through google.script

Mentioned below is my HTML tags:

              <div class="collapsible-body">
                <ul>
                  <li><a href="https//:script.google.com/macros/s/AKfycby16LFvQvDlEh-pUhHoq36QxwHRxIjshVvg3Pd3EOw7Of6Bu4ic/exec?v=dash" class="waves-effect active">Dashboard<i class="material-icons">web</i></a></li>

                </ul>
              </div>
            </li>
            <li class="bold waves-effect"><a class="collapsible-header">Leave Management<i class="material-icons chevron">chevron_left</i></a>
              <div class="collapsible-body">
                <ul>

currently I receive the following error page: script.google.com refused to connect.

How can we achieve to do navigate correctly in this case.

Upvotes: 0

Views: 150

Answers (2)

ziganotschka
ziganotschka

Reputation: 26796

What does your doGet() function looks like?

For a WebApp with multiple html pages, you can navigate by retrieving the final part of the URL as an e.parameter in doGet().

Sample:

function doGet(e) {
  if (!e.parameter.v) {
    return HtmlService.createTemplateFromFile("index").evaluate();
  }
  else{
  return HtmlService.createTemplateFromFile(e.parameter['v']).evaluate();
  }
}

Upvotes: 1

cvekaso
cvekaso

Reputation: 865

The biggest problem here is the authorization. I don't know what you put for permission, but check this GoogleAppScripts

GithubGoogleAppScripts

Upvotes: 0

Related Questions