ultraloveninja
ultraloveninja

Reputation: 2139

What is this script tag?

I've never seen it used like this before:

<script src="{{ file.name_js }}"></script>

Is this better?

Upvotes: 6

Views: 191

Answers (3)

daryl
daryl

Reputation: 15207

Looks to me like some form of template parsing, in which anything inside {{ }} parenthesis would get replaced to a specific value on the server side.

Upvotes: 0

Uku Loskit
Uku Loskit

Reputation: 42040

looks like somekind of a templating language Django has the same kind of tags for example.

Upvotes: 1

Brad
Brad

Reputation: 163438

This is something from a templating engine, such as Smarty or similar.

Everything between the brackets {{ }} is handled server-side, likely so that the script files can be minified server-side easily and the file name be updated to the minified version, or something from a variable.

Upvotes: 8

Related Questions