Question

I am using JSLink feature of SharePoint 2013, My JSLink file has code to get current user id and other details, for this I need to add reference of jQuery file.

I tried adding those files in in JSLink on edit page web part section separated by semicolon, but that didn't work.

In short, I need way where in I can reference the library files for JSLink code similar to script tag in html file.

Was it helpful?

Solution

Instead of adding script tags for other JavaScript files in your code, you can set JavaScript files in JS Link propery by | separated. Please see below example:

JSLink="~sitecollection/_catalogs/masterpage/jQuery.js|~sitecollection/_catalogs/masterpage/my-custom-field.js"

Here, it will first load jQuery.js and then my-custom-field.js in page.

Hope this will help you!

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top