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.

Était-ce utile?

La 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!

Licencié sous: CC-BY-SA avec attribution
Non affilié à sharepoint.stackexchange
scroll top