2013-02-06 14 views
0

如何使用函數返回字符串內的html,在谷歌應用腳​​本中的html模板內部?谷歌應用腳​​本html模板問題

例如,這裏是我的code.gs:

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

function getHtml(){ 
    return "<b> hello there </b>"; 
} 

,在我的HTML文件 '的test.html' 我有以下幾點:

<html> 
<?= getHtml() ?> 
</html> 

你會看到的結果是什麼像這樣:

enter image description here

我怎樣才能改變這種做法,它產生打招呼有粗體,沒有顯示標籤?

非常感謝

回答

4

使用武力印刷:

<?!= getHtml() ?> 

的解釋here

+0

謝謝科瑞 – Sherlock