tosenzzz / trimpath

Automatically exported from code.google.com/p/trimpath
0 stars 0 forks source link

Including the tpl file in html document #20

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
How can i do it without iframe and SSI?
I need it because i have complex html in tpl and tag textarea is not the
best way to put tpl in it (because very often i have to put tags
<textarea></textarea> inside existing textarea so the parent textarea is
closed).
Does TrimPath has such function that retrieves content of the file in variable?

var tpl = TrimPath.someSuperFunction("/tpl/myjtemplate.tpl");

it would be cool... =)

Original issue reported on code.google.com by mennanov@gmail.com on 14 Nov 2008 at 8:36

GoogleCodeExporter commented 8 years ago
You can easily write this. Have a look at http://embeddedjs.com to see how it 
does that.

Original comment by sarat.pe...@gtempaccount.com on 5 Dec 2008 at 6:25

GoogleCodeExporter commented 8 years ago
If <textarea> is giving you a problem, try using a script tag. If you set the 
type 
attribute to something the browser doesn't recognize it won't look at the 
content.

<script type="text/trimpath-template" id="myTemplate">
template here...
</script>

Of course, now you have a problem if the template contains <script> tags. If 
you want 
to avoid all such problems then use some Ajax library to download the template 
and 
pass it TrimPath.parseTemplate(). 

Original comment by breischl@gmail.com on 5 Dec 2008 at 9:28

GoogleCodeExporter commented 8 years ago
ok, thx a lot

Original comment by mennanov@gmail.com on 7 Dec 2008 at 11:20