mobilegoogle-apps-scripttwitter-bootstrap-3

Mobile Viewing for Google Apps Script with Bootstrap


I am trying to design a mobile first web app using Google Apps Script.

I would try to replicate the most basic Bootstrap page (http://getbootstrap.com/examples/navbar) in a Google Apps Script.

This is the way the bootstrap page should render on my mobile device:

enter image description here

but instead my page loads like this:

enter image description here

This is my code.gs:

function doGet() {
  return HtmlService
      .createTemplateFromFile('index')
      .evaluate()
      .setSandboxMode(HtmlService.SandboxMode.NATIVE);
}

My index.html is copied and pasted from http://getbootstrap.com/examples/navbar with CDNs replaced as appropriate.

I figured HtmlService.SandboxMode.NATIVE was important to get this to work but doesn't seem to work.

UPDATE 1 - (THANKS FOR YOUR RESPONSES!)

in IFRAME: enter image description here

IFRAME console errors (2): enter image description here

NATIVE console errors (lots): enter image description here

Bottom line - clearly GAS is not liking it and doesn't seem super straight forward - I've ended up turning the GAS into an API which returns JSONP from the spreadsheet I need - much more straight forward.


Solution

  • Apparently Google can't load Bootstrap from their server, try copying everything to GAS and include in the page as explained in best practices. Also switch back to IFRAME when testing.