Link to home
Start Free TrialLog in
Avatar of Isaac
IsaacFlag for United States of America

asked on

SharePoint MasterPage and Javscript error

Hello all,

I'm working on a client request to allow them to edit a mission statement place in the header and edit the footer. What comes to mind to allow this to happen is using SPServices to show the information from a list. Right now, instead of placing javascript file it in a CEWP, I wanted place it in the masterPage so that it can carry through out the website. Unfortunately, I keep getting errors when I try to reference my javascript file.

I get a "Cannot make a cache safe URL" when I reference use <SharePoint:ScriptLink>, a "Syntax Error" when using a <script> tag and it doesn't show up at all when I reference the the file in <asp:ContentPlaceHolder id="PlaceHolderAdditionalPageHead" runat="server"> tag. Thanks

I'm using a javascript test file that has an alert("I'm in"); that I have tested and I know it works. I may be missing something on how to reference a javascript file in a SharePoint masterpage. Please let me know if I'm doing something wrong.
ASKER CERTIFIED SOLUTION
Avatar of Jamie McAllister
Jamie McAllister
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Isaac

ASKER

User generated imageThanks but I don't think reusable content will be an approach I will pursue. Even when I reference the js file correctly, I get a syntax error. Attach is want I'm receiving.
I've seen this before when the encoding was different. Open your file in Notepad and try saving it as ANSI and UTF8 and see if that changes things. Failing on the first character can hint at something like that.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Officelabs_LarryK
Officelabs_LarryK

I'm not sure why you would use SPServices when a straight forward dataview webpart would do the same job here.