简体   繁体   中英

How to process scriptlets in my HTML file instead of them showing plain-text?

I can't figure it out how I can get the HTML to process the extension/caller (scriptlets) that look like this <?= var data = getData()?> . Here is my script code link .

Please check out my error: 在此处输入图片说明

From my answer here :

If you have the <?...?> scriptlets in your HTML file when you evaluate with the HTMLService you need to use createTemplateFromFile() otherwise they will be treated as plain text. The createHTMLOutputFromFile() won't work for evaluating the script tags.

function doGet() {
 return HtmlService.createTemplateFromFile('Index').evaluate();
}

You should take a look at the HTMLService best practices for async loading.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM