codepb/jquery-template

Unable to get external templates working.

chrisfromthelc opened this issue · 2 comments

I'm having a bit of trouble trying to get external templates working.

I can take the same exact code, and enclose in <script type="text/html" id="template"> tags per the instructions, and it works just fine. However, if I move that code out to an external template, I get nothing (not even the template's tags) in the main HTML container.

Relevent jQuery:

$.getJSON( devicesURL, function(result) {
  $.each(result, function( index, value ) {
    $(".main").loadTemplate("templates/test.html",result);
  });
});

Template:

    <div data-content="name"></div>
    <div data-content="restURL"></div>

Screenshot of the folder structure:
screen shot 2016-01-03 at 11 09 47 am

What am I missing?

Do you get any errors in the console when they don't load?

Closing as no response