0

I am using sp2013. I have builded a visual webpart in visual studio. In this webpart I have a hyperlink. I add some jQuery effect on this hyperlink in custom.js. I load in my masterpage first the jQuery.js file and after this the custom.js. I have checked in the files and publish them. The files are stored in the style library. Here are my script tags in my masterpage:

<SharePoint:ScriptLink language="javascript" name="~sitecollection/Style Library/Branding/jquery-1.11.1.js" runat="server" Localizable="false" />
    <SharePoint:ScriptLink language="javascript" name="~sitecollection/Style Library/Branding/customJS.js" runat="server" Localizable="false" />

When I log in with the farm account it is working. When I log in with a normal user with read permissions it is not working. In the IE debugger console tab I see this error:

SEC7112: Script from http://portal.myCompany.dev/_layouts/15/AccessDenied.aspx?Source=http%3A%2F%2Fportal%2EmyCompany%2Edev%2Fstyle%20library%2Fbranding%2Fjquery%2D1%2E11%2E1%2Ejs&Type=item&name=0d765d12%2D405b%2D4f3c%2Dadf1%2De8647fbb8761&listItemId=56 was blocked due to mime type mismatch Home.aspx

SCRIPT5009: '$' is undefined customjs.js, line 2 character 2

SEC7115: :visited and :link styles can only differ by color. Some styles were not applied to :visited. Home.aspx

0

I faced some issues using the $ sign. Try using jQuery instead of $ in your javascript code.

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.