More in this section

Forums / Developing with Sitefinity / ResourceLinks ResourceFile - script defer attribute?

ResourceLinks ResourceFile - script defer attribute?

2 posts, 0 answered
  1. Thomas
    Thomas avatar
    223 posts
    Registered:
    19 Jan 2011
    06 Oct 2011
    Link to this post
    Hi,

    How can I set the "defer" attribute on a script added through a ResourceFile control?

    Example:

    <sf:ResourceLinks ID="resourceLinks" runat="server" UseEmbeddedThemes="false">
        <sf:ResourceFile Name="~/js/script.js" Static="true" />
    </sf:ResourceLinks>

    This will generate the following script in the page head:

    <script src="/js/script.js" type="text/javascript"></script>

    I'd like to add the defer attribute on this script element.

    Thanks.
  2. Lubomir Velkov
    Lubomir Velkov avatar
    688 posts
    Registered:
    03 Nov 2014
    07 Oct 2011
    Link to this post
    Hello Thomas,

    Unfortunately this is not possible out of the box. If you wish to add a script with such attribute you could use a master page and hardcode the script tag there.

    All the best,
    Lubomir Velkov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered