0

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.

1
  • You can get the current user id using _spPageContextInfo object. what other details you need? Jul 16, 2019 at 7:57

1 Answer 1

1

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!

1
  • 1
    I was separating the files by semicolon, thanks Jul 16, 2019 at 9:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.