Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7163245
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:52:14+00:00 2026-05-28T13:52:14+00:00

My Templates: <script id=tmp_servicebuttons class=template type=text/x-jquery-tmpl> <li><a class=notification href=${id}><img src=${imgsrc}/></a></li> </script> <script id=tmp_navigation class=template

  • 0

My Templates:

        <script id="tmp_servicebuttons" class="template" type="text/x-jquery-tmpl">
            <li><a class="notification" href="${id}"><img src="${imgsrc}"/></a></li>
        </script>
    <script id="tmp_navigation" class="template" type="text/x-jquery-tmpl"> 
        <header>
            <nav>
                <ul class="top_bar_notifications">
                    <li>
                        <a href="#home" class="go home">
                            <img src="./resources/img/homebtn.png" alt="Home">
                        </a>
                    </li>

                    <li>
                        <a href="#" class="back">
                            <img src="./resources/img/backbtn.png" alt="Home">
                        </a>
                    </li>
                </ul>
            </nav>
...

My Home page:

    <!-- First Page after splash with main buttons -->
    <script id="tmp_home" class="template" type="text/x-jquery-tmpl">   
        <section id="${$item.panel_id}" class="home category panel">

            {{tmpl "#tmp_navigation"}}
...

How I am trying to append:

var data = [{"id": "1", "imgsrc": "./resources/img/servicebtn.png"}];
$("#tmp_servicebuttons").tmpl(data).appendTo(".top_bar_notifications");

When I do the following, my navigation template seems to only update on certain sections. I have four sections total. It will update two of the four templates and my home template for some reason is not affected. Anyone know why this would work for one section but not the others? Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T13:52:15+00:00Added an answer on May 28, 2026 at 1:52 pm

    It turned out I was trying to insert html data into my template. That HTML was being interpreted as text. I ended up creating a new template for the LIs and then appended the tmpl to the UL.
    Created a template:

      <script id="tmp_servicebuttons" class="template" type="text/x-jquery-tmpl">
            <li><a class="notification" href="${id}"><img src="${imgsrc}"/></a></li>
      </script>
    

    then appended the populated data to the UL

    var data = JSON.parse(buttons);
    $(data).each(function(){
        var data = [{"id": this.id, "imgsrc": this.imgsrc}];
        $("#tmp_servicebuttons").tmpl(data).appendTo(".top_bar_notifications");
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using .tmpl() to fill out templates like so <script type=text/x-jquery-tmpl id=template> <form
I have my own templates with this code in head: <script type=text/javascript src=http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js></script> <script
<script type=text/javascript src=<?php echo $this->baseurl; ?>/templates/mytemplate/javascript/min.js></script> <script type=text/javascript> var mooTrans= Fx.Transitions.<?php echo $this->params->get('transition','Sine.easeOut') ?>;
I'm having trouble getting nested JavaScript inside Underscore templates to run. <script type=text/template id=myTemplate>
Using jQuery templates is easy for some simple data structures. <script type=jquery/x-jquery-tmpl id=myTemplate> <li>
Hallo I have this script: <? require(lib2/config.inc.php); require(lib2/tpl.class.php); require(lib2/db.class.php); require(lib2/um.class.php); $tpl = new template(templates,
i have some javascript code in Django templates like this <script type=text/javascript> pager.init(); pager.showPageNav('pager',
After loading a PHP template (using jQuery's load function), this simple script won't make
I have follwing JSON: {mykey:[{name:Jak,interests:movies}]} and following opensocial app code: <script type=text/os-template require=mykey> <ul>
I want to emit some js from jQuery templates e.g I have template like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.