Store a jsRender template in a separate js file

后端 未结 5 620
天涯浪人
天涯浪人 2020-12-14 19:24

Is it possible to store a jsRender template in a separate file?

I want to store it in a separate file and make a reference of it in my page.

something like t

5条回答
  •  -上瘾入骨i
    2020-12-14 19:40

    in my experience, you don't need to work with that trouble, you just need to append the template to the page before you using it. see below code.

    in this way, you don't need to request a ajax file everytime you want to render a js template

提交回复
热议问题