Sunday, 15 May 2011

html - Google form in the Google doc's sidebar -



html - Google form in the Google doc's sidebar -

good day! i'm writing script creates sidebar in google doc, in see google form. utilize insert link web page. script's code 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 sentiment of import us!</p> <iframe src="https://{ *the insert link web page*}" width="290" frameborder="0" marginheight="0" marginwidth="0">Загрузка...</iframe> </div>

scripts.html:

<script> $(function() { $('.content').show(); }); </script>

this results in formed sidebar, except phrase "your sentiment of import us!" in sidebar there nil else. tell me i'm doing wrong , there possible utilize google forms in google doc's sidebar?

google apps script html service restricts iframe contents severely. see documentation regarding element restrictions.

this has been raised issue 2616, has been reported "workingasintended".

as alternative, can apply technique single google form multiple sheets sidebar, embed form's html.

html google-apps-script google-docs sidebar google-form

No comments:

Post a Comment