Quick Links

Other stuff

Site owners

  • Bruce Mcpherson

Services‎ > ‎Desktop Liberation‎ > ‎GAS and Sites‎ > ‎

Displaying code samples on Google Sites

In How to embed gist samples in Google Sites I showed how to publish your source code in your web site.  This still means that we need to create a Gist as well as maintain the code in Google Apps Script.  this post about the scriptApp class shows how to publish your code from your Google Script through a web App. Now we want to embed that published code in a Google Site.

Well we can't simply put  html generated by the Google Apps Html service (here's an example) in an iFrame gadget, because that results in this error "display forbidden by X-Frame-Options", so we have to figure out some other solution. 

Here's the code, embedding itself in this gadget. 

and the shared code from the mcpher library

For how to do this see
You are done. You can now publish and embed scriptdb and script data without worrying about cross domain stuff.  For help and more information join our forum,follow the blog or follow me on twitter . For more on Google Apps Script try Delegation to Google Apps Script or Gas Publisher






Comments