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

Updated: Template composition fails with compiled templates #53

Open
pagles opened this issue Jan 20, 2011 · 1 comment
Open

Updated: Template composition fails with compiled templates #53

pagles opened this issue Jan 20, 2011 · 1 comment

Comments

@pagles
Copy link

pagles commented Jan 20, 2011

This is an update to closed issue #52
I have mofified the example of "Example: Using {{tmpl}} to render hierarchical data." in http://api.jquery.com/template-tag-tmpl/ to highlight the issue:

test.html



<style>
table {float:left;clear:right;border-collapse:collapse;width:370px;background-color:#f8f8f8;margin:4px;} table td {border:1px solid blue;padding:3px;}
table th {font-weight:bold;border:2px solid blue;padding:1px;} table tbody {border:2px solid blue;} button {float:left;margin:4px;width:70px;}
</style>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script src="http://ajax.microsoft.com/ajax/jquery.templates/beta1/jquery.tmpl.min.js"></script>
<script src="test.js"></script>

<table><tbody><tr><th>Title</th><th>Languages</th></tr></tbody>
<tbody id="movieList"></tbody></table>
<button id="foreignBtn">Foreign</button>
<button id="dramaBtn">Drama</button>

</body>
</html>

test.js
$(document).ready(function(){
var movieTemplate = [
"",
"${Name}",
"{{tmpl(Languages.results) 'languageTemplate'}}",
"</tr",
].join("\n");

    var languageTemplate = "<em>${Name} </em>";

    $.template("movieTemplate", movieTemplate);
    $.template("languageTemplate", languageTemplate);

    $( "#foreignBtn" ).click( function() {
    getMovies( "Foreign", 0, 4 );
    });

    $( "#dramaBtn" ).click( function() {
    getMovies( "Drama", 0, 4 );
    });
})

The above will fail in firebug with: c.tmpl is not a function

@rdworth
Copy link
Contributor

rdworth commented Oct 8, 2011

Thanks for taking the time to submit this issue. Just wanted to let you know this plugin is no longer being actively developed or maintained by the jQuery team. See README for more info.

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

2 participants