blueimp/JavaScript-Templates

script tag that contains template is in another context

giolvani opened this issue · 3 comments

Hi, i'm using the code

tmpl("tmpl-demo", {})

but my code is in iframe and my script tag that have a template content, is out this iframe, i.e., in my parent!

How can i take the element #tmpl-demo?

How to access content on another frame is out of context of this library, but you'll find documentation about this elsewhere on the web.
After you retrieved the content, simply call the tmpl method with the content string as first argument instead of a document ID (which is also explained in the API documentation).

Thank you so much Sebastian,

My fault, i didn't realized this part of documentation!

Até a próxima...

You're welcome. :)