0

In some VS Sharepoint 2013 solution I have set up as follow:

In mapped Layouts I have folder jQueryTest, and jquery.js in it.

I have Scirpt Element with Elements.xml with:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction Location="ScriptLink" Sequence="1" ScriptSrc="~site/_layouts/jQueryTest/jquery-1.11.1.min.js" />
</Elements>

But in the web broser console I get:

GET http://some_url_here/sites/some_site_here/_layouts/jquerytest/jquery-1.11.1.min.js [HTTP/1.1 404 Not Found 15ms]

If I manually try jQuryTest in url, I get 401 Unauthorized access. Manually accessing jquerytest give me 404.

In 15/TEMPLATE/LAYOUTS/ I have jQueryTest folder. So I should have camel case in url.

Capital letters where lowercased. But IIS is CASE SENSITIVE. What can I do now?

Partial solution Looking into IIS application pools and sites for authentication settings I found that IIS see _layout folder differently from physical folders structure correct URL should look like

GET http://some_url_here/sites/some_site_here/_layouts/15/jquerytest/jquery-1.11.1.min.js

I have checked in web browser, and this new URL works.

So two questions I need answer to in order to get that solution working:

  1. Why SharePoint ScriptLink generate lower case url?
  2. Why SharePoint/IIS put my data in _layouts/15/?
  • 1
    Just to eliminate the obvious, did you try to open jQuery library by entering url in the browser? – Slaven Semper Dec 8 '14 at 13:04
  • Yes. jQueryTest in url give me 401 Unauthorized access (as expected), while jquerytest give me 404. Though, I do not know how to check on server if my files are in the right place. So if You know where to look for site layout, then post it as answer! – przemo_li Dec 8 '14 at 13:06
  • 1
    Which is your sharepoint version? – Amal Hashim Dec 8 '14 at 13:06
1

Please take a look at C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\LAYOUTS if you're using SP 2013.

Please take a look at C:\Program Files\Common Files\microsoft shared\Web Server Extensions\14\TEMPLATE\LAYOUTS if you're using SP 2010.

0
  1. I needed to use lowercase folder.
  2. I needed to use _layout/15 folder.

Both folders are visible in IIS admin when browsing structure of site.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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