Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<script src=??? #823

Closed
JamesGiaquinto opened this issue Aug 30, 2023 · 0 comments
Closed

<script src=??? #823

JamesGiaquinto opened this issue Aug 30, 2023 · 0 comments

Comments

@JamesGiaquinto
Copy link

Hi, I worked with mustaching on the PrairieLearn project, but I guess they had other code that shortcut connecting documents. I have the key:value dictionary in .json and I'm clear on how to "{{item}}</tag" set up the template. I still get an error telling me there is no reference for mustache.js or that it's not allowed.
I've looked for articles and tutorials but I'm just not getting the documents to find each other. I'm trying to find the script line to put in the or as src= but I'm just not making it work.
I thought it would be as easy as

<script src="https://raw.githubusercontent.com/janl/mustache.js/master/mustache.js"></script> Then I would go on to the html and add {{#catalog}}
    {{#items}}
  • {{name}}
  • {{/items}}
But, that's not working. It come out blank and console throws errors. I was able to use fetch() to get the .json data but that wasn't enough to make templating work.

What I want is to have all the html in .html and all the objects/data dictionary in .json. A lot of tutorials show how to just use the html file with javascript in it. Ok, I don't know how but it there is any way y'all can help me link the references together simply that would be great. I keep feeling like the answer must be right in front of my face but I can't see it. Ok, thanks for whatever help you can offer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant