0

I have the following in my HTML:

<?!= include('Stylesheet'); ?>

include in Code.gs is:

function include(filename) {
  return HtmlService.createHtmlOutputFromFile(filename)
      .getContent();
}

However, when I load the page, <?!= include('Stylesheet'); ?> shows up as plain text and the CSS is not included. I feel like I am making an obvious mistake here, I have read this documentation and I just can't figure it out.

2
  • 1
    You may want to share more parts of your code. Commented Jul 18, 2016 at 9:01
  • Looks that you already solved the problem. Please instead of editing your question, post the solution as an answer. Commented Jul 27, 2016 at 19:57

1 Answer 1

1

I found the problem, I was using sandbox mode in doGet().

Here is what I did to fix it, I changed

function doGet() {
    return HtmlService.createHtmlOutputFromFile('index')
        .setSandboxMode(HtmlService.SandboxMode.IFRAME);
}

to

function doGet(request)
{
    return HtmlService.createTemplateFromFile('index')
        .evaluate();
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.