Export to GitHub

trimpath - issue #20

Including the tpl file in html document


Posted on Nov 14, 2008 by Grumpy Rhino

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... =)

Comment #1

Posted on Dec 5, 2008 by Helpful Hippo

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

Comment #2

Posted on Dec 5, 2008 by Swift Ox

If 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.

template here...

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

Comment #3

Posted on Dec 7, 2008 by Grumpy Rhino

ok, thx a lot

Status: New

Labels:
Type-Defect Priority-Medium