Discussions

Expand all | Collapse all

Referencing mustache.js in quickbase pages

  • 1.  Referencing mustache.js in quickbase pages

    Posted 06-19-2017 08:54
    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 :( )


  • 2.  RE: Referencing mustache.js in quickbase pages

    Posted 06-19-2017 08:57
    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.


  • 3.  RE: Referencing mustache.js in quickbase pages

    Posted 06-19-2017 10:04
    Fixed - Typo in script reference.


  • 4.  RE: Referencing mustache.js in quickbase pages

    Posted 06-19-2017 12:01
    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.


  • 5.  RE: Referencing mustache.js in quickbase pages

    Posted 06-20-2017 09:55
    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


  • 6.  RE: Referencing mustache.js in quickbase pages



  • 7.  RE: Referencing mustache.js in quickbase pages

    Posted 06-21-2017 05:51
    >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


  • 8.  RE: Referencing mustache.js in quickbase pages

    Posted 06-21-2017 08:13
    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.


  • 9.  RE: Referencing mustache.js in quickbase pages

    Posted 01-12-2018 18:56
    I just started working with Mustache and I also get a Mustache not defined message if I do not include it. This works when referencing https://cdnjs.cloudflare.com/ajax/libs/mustache.js/2.3.0/mustache.js

     <script>
          var view = {
            name : "Joe",
            occupation : "Web Developer"
          };

          function loadtemp(){
            var output = Mustache.render("{{name}} is a  {{occupation}}", view);
            document.getElementById('person').innerHTML = output;
          }
        </script>

      <body onload="loadtemp()" >
        <p id="person"></p>
      </body>