5

i wanna to ask how to render and insert template to specific div. As we know from meteor wiki, this how to do that :

UI.insert(UI.render(Template.something), document.body);

and i place that to rendered or onAfterAction on IronRouter map, and it works. I have a div with id = "content", i wanna place the Template.something to that div, so i try with ordinary query code-like :

UI.insert(UI.render(Template.something), $('#content'));

and i place that to rendered or onAfterAction on IronRouter map, but it doesn't works. please help me how to render and insert to specific div? thanks

yozawiratama
  • 4,209
  • 12
  • 58
  • 106

1 Answers1

8

As the documentation says, UI.insert() expects a DOM node as its second argument.

UI.insert( UI.render( Template.something ), $( '#content' ).get(0) ));

If that is not working then try both Template.something and $( '#content' ).get(0) in then dev console to see what values they have.

user728291
  • 4,138
  • 1
  • 23
  • 26