Skip to main content
Question

Referencing mustache.js in quickbase pages

  • June 19, 2017
  • 0 replies
  • 97 views

I'm looking to reference the mustache.js source from within a quickbase html page - how do I do this.

(I looked at the example at haversine consulting - but it doesn't work anymore :( )
This topic has been closed for replies.

  • Author
  • Registered
  • June 19, 2017
I am getting an error
GET https://login.quickbase.com/js/mustache-0.5.0 404 (Not Found)

when the script that is trying to be loaded is referenced at www.quickbase.com in the code.

  • Author
  • Registered
  • June 19, 2017
Fixed - Typo in script reference.

  • Registered
  • June 19, 2017
Maybe one of these URLs is what you want:

https://login.quickbase.com/js/mustache-0.5.0.js

https://assets.quickbasecdn.net/res/75807-10/js/mustache-0.5.0.js

Note the CDN URL has a release number in it (75807-10) and will eventually go stale as QuickBase pushes out new releases. This is why some of my demos break over time. It might be better to pull the library (1) from a code page where you can completely control the library version or (2) from a public CDN whose URL does not change.

  • Author
  • Registered
  • June 20, 2017
Despite referencing https://www.quickbase.com/js/mustache-0.5.0.js in the page code

I still get unsafe script warnings for http://www.quickbase.com/js/mustache-0.5.0.js 

so I assume that the server that stores this is not running a current SSL cert

  • Author
  • Registered
  • June 20, 2017

  • Registered
  • June 21, 2017
>I still get unsafe script warnings for http://www.quickbase.com/js/mustache-0.5.0.js 

You are using mixed content here - the error should go away if you use https instead of http.

Also if you are using Mustache on a QuickBase page Mustache is already loaded! To prove this just paste code into the console:

var person = {
    firstName: "Christophe",
    lastName: "Coenraets",
    blogURL: "http://coenraets.org";
};
var template = "<h1>{{firstName}} {{lastName}}</h1>Blog: {{blogURL}}";
var html = Mustache.to_html(template, person);
console.log(html);
// output: <h1>Christophe Coenraets</h1>Blog: http://coenraets.org

  • Author
  • Registered
  • June 21, 2017
The interesting thing was that I had the https in the script reference on the page and was getting the mixed content warning.

I am using the Pages section of the App to create HTML pages - if I omit the script reference it just tells me Mustache is not defined.