I have created a custom list definition and detailed in many articles across the net I have specified my file in the JSLink property of the view. For some reason it is no longer working.

<JSLink Default="TRUE">/_layouts/15/myfile.js</JSLink>

Note: I have also tried ~layouts. But for some reason when I create the list it is no longer working. I have tried creating the list in both Powershell and the UI.

When I set the JSLink property on the web part on the view, it works as expected, but no through the schema.xml any more.

The javascript is trivial, basically just formatting a date not to show the time. Which is irrespective because the file isn't loaded. I've put a console.log("") message inside the file, which is only called when I set the JSLink property on the web part itself. I can also see from View Source that the file is not being added.

I have checked the JSLink property on the View in Powershell and it is set to the one I define in the schema.xml

Is there something I am missing?

  • Have you got a solution for this? I'm also getting the same issue. Could you please share if you have got it worked ?
    – Anish V
    Commented Jan 10, 2014 at 10:15

3 Answers 3


If the javascript file is located directly in the folder you don't have to specify relative/full path as SharePoint will figure it out itself.

If you however have it located in a specific folder in either a document library or a in layouts, only then are you required to add a relative/full path to the javascript file.


(Located in layouts)


(Located in a folder)

// Located in subfolder in Layouts
// Located in subfolder in Style Library on root
<JSLink>~sitecollection/Style Library/MyJSFiles/MyCustomJSFile.js</JSLink>
// Located in subfolder in Assets

Example with multiple javascript files

(Located in layouts)

// OOB SharePoint uses this method as well

Try to use one of the tokens

  • ~site
  • ~sitecollection
  • ~layouts
  • ~siteLayouts
  • ~siteCollectionLayouts

I faced with problem that JSLink does not work without them.


In some cases you should encode "~" symbol.

  • Thanks, yeah, as stated, I've tried the ~layouts token. No joy.
    – SteveCl
    Commented Oct 16, 2013 at 8:48

try this, it works for me, as I deployed solution using Visual Studio,

 <JSLink Default="TRUE">../_layouts/15/myFeaturesFolder.Features/myJSLINKFILE.js</JSLink>

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.