Good day! I'm writing a script that creates a sidebar in Google doc, in which I would like to see Google form. For this I use the insert link to a Web page. Script's code is as follows:
function onOpen() {
AddonMenu = DocumentApp.getUi().createAddonMenu();
AddonMenu.addItem('Form', 'openSidebar')
.addToUi();
}
function openSidebar() {
var html = HtmlService.createTemplateFromFile('Sidebar')
.evaluate()
.setSandboxMode(HtmlService.SandboxMode.NATIVE)
.setTitle('Form')
.setWidth(300);
DocumentApp.getUi().showSidebar(html);
}
Sidebar.html:
<!-- layout -->
<?!=HtmlService.createHtmlOutputFromFile('Content').getContent();?>
<!-- 3rd party scripts -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<!-- application scripts -->
<?!=HtmlService.createHtmlOutputFromFile('Scripts').getContent();?>
Content.html:
<div class="content">
<p>Your opinion is important to us!</p>
<iframe src="https://{ *the insert link to a Web page*}" width="290" frameborder="0" marginheight="0" marginwidth="0">Загрузка...</iframe>
</div>
Scripts.html:
<script>
$(function() {
$('.content').show();
});
</script>
This results in a formed sidebar, but except the phrase "Your opinion is important to us!" in sidebar there is nothing else. Tell me what I'm doing wrong and there is it possible to use Google forms in the Google doc's sidebar?