b:template-script Tag - Blogger Tags References

b:template-script - Blogger Tags References
<b:template-script> is an instruction tag that allows you to call a JavaScript file hosted on blogger server. Normally this tag is founded in official themes that are shared by blogger team. This tag is mainly used in official Layouts Version 3 themes.

These JavaScript files are officially made for official themes for blogger and these files cannot be used in other themes because they are made for specific layout version of blogger.

Syntax of <b:template-script> Tag:

The syntax for <b:template-script> is just simple. This tag only supports one mandatory attribute ( name ) which contains the script name to call its contents. You can check its simplicity below.
<b:template-script name='FILE_NAME'/>

HTML Output:

HTML rendering of b:template-script is similar to the code provided below.
<script type="text/javascript" src="https://FILE_NAME.js"/>

Example Code:

If you are wondering about the example for this tag now let me cover it for you.

For example, this is the XML code that is used in the official blogger theme.
<b:template-script async='true' name='indie' version='1.0.0'/>
In the above XML code, the highlighted text is the name of the file to call from the blogger server.

The output rendered by the browser for the above XML code will be similar to this.
<script type="text/javascript" src="https://resources.blogblog.com/blogblog/data/res/3410439338-indie_compiled.js" async="true"></script>
Here in the above HTML code, the highlighted text is the URL of the file which we have called by its name using <b:template-script> tag.

Supported Attributes:

By default, this tag only accepts one attribute ( name ), but there are some other optional attributes that can be used with this tag. The list of supported attributes for this tag are provided below with their description respectively.
AttributeDescriptionStrictness
nameIt is the name of file without extension. eg: indie not indie.jsMandatory
versionVersion name specifies the version of file which is called.Optional
asyncThis attribute specifies how to call a script synchronously or asynchronously. Supported Values are true & false.Optional
inlineThis attribute defines how should be the rendering of the file. Supported Values are true & false.Optional

Wrap Up:

Now it's time to wind up this topic. That's all about <b:template-script> Tag.

Đăng nhận xét

Mới hơn Cũ hơn