Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Reusing javascript file across display templates in different site collections

$
0
0

Is it possible to reuse the same javascript file across display templates in different site collections? For example, I have a search center site athttp://xyz.com/search and a root site at http://xyz.com. These sites have their own set of display templates located at /_catalogs/masterpage/display templates.

I have a javascript that I would like to reuse in display templates in both search site and root site. I am using the following code to include javascript file:

<body><script type="text/javascript">
        RegisterSod("customtransform.js", _spPageContextInfo.webAbsoluteUrl + "/Style%20Library/People/SearchBox_Functions.js");
        EnsureScriptFunc("customtransform.js", null, function () { });</script><div id="Control_SearchBox">

Not sure how I can reuse the javascript file. Can someone provide pointers?

Thank you!


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>