0
votes

Working on getting javascript files deployed with our solution.

Added a module for the scripts with jquery-1.7.1.min.js added to it for example. Elements.xml is:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module Name="Scripts" Url="JqueryFiles1">
    <File Path="Scripts\jquery-1.7.1.min.js" Url="jquery-1.7.1.min.js" />
</Module>
</Elements>

It successfully deploys the javascript file to the document library "JqueryFiles" perfectly file (I can even download them from the library and verify they have content).

Problem is when I load them in the masterpage, the scipt files come up blank (file exists but is empty) when I check them.

Tried loading using a standard script tag, SharePoint:ScriptLink and CustomAction in the solution, same thing everytime.

<SharePoint:ScriptLink runat="server" Defer="false" Name="~sitecollection/JqueryFiles/jquery-1.7.1.min.js" />
<script src="../../JqueryFiles/jquery-1.7.1.min.js" type="text/javascript"></script>

Any thoughts?

1
Can you clarify what you mean by "the script files come up blank" what do you mean? I'm confused since you say you can download them and verify there's content. - Robbert
I can navigate to All Site Content, see the javascript file in the document library and download a copy to verify it has content in the file, but when inspect the file with browser developer tools, it is literally blank (no code, just an empty file). So the file gets uploaded to the sharepoint site properly, but when the masterpage tries to load it something isn't working right. - Neovivacity

1 Answers

1
votes

It looks as though you deploy to Url="JqueryFiles1". Remove the 1 and it should be ok.