my jquery template displays [object Object] when I pass the following jquery anchor object.
moreinfoAnchor = $("<a></a>");
moreinfoAnchor.attr('id', 'moreLink-' + this.id);
moreinfoAnchor.text("test");
jquery template code:
$("#test").tmpl({
link: moreinfoAnchor
});
How do I display actual anchor with jquery template?
Here’s one way to do it.
Build your anchor tag with jQuery:
Turn your jQuery anchor tag into a plain string:
Then apply the template:
You’ll also have to make sure your template is set up using the
htmltemplate tag, something like this: