Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a SharePoint solution with an Application Page, which references several Javascript files. I have a sandbox server where I test and a production server. I did not set up either of these environments. When I deploy the solution on the sandbox server, everything works fine. When I deploy the solution on the production server, I get a Javascript error. The error indicates that a particular function "is not a function".

If I comment out the first offending line, I get the same error again when it tries to execute another function.

Are there any setup issues that might account for the difference in behavior between these two environments? I am deploying the same exact WSP files in each case.

share|improve this question
    
Is this particular function yours, or is it something else which is not being loaded correctly? –  Anatoly Mironov Feb 6 '13 at 6:09
    
The first function was the .dialog() function in jquery UI. The second one was one I wrote. –  Jeremy Feb 6 '13 at 22:21
    
Did you ever get this figured out? –  Steve Lineberry Feb 14 '13 at 19:52
add comment

2 Answers

Try using fiddler (http://www.fiddler2.com) to make sure that all of your js files are bring loaded properly.

Once you have determined that they are all being loaded in the browser, use the IE dev tools (F12) and set some breakpoints in your js code and that might help determine the issue.

It could also be a timing issue of maybe not all of the js code is loaded when you are making your call. Does any of your JS code depend on the CSOM or SharePoint JS libraries? If so are you using ExecuteOrDelayUntilScriptLoaded (http://msdn.microsoft.com/en-us/library/ff411788(v=office.14).aspx) to call your function?

share|improve this answer
add comment

I found a solution. Instead of putting the script tags in this placeholder:

<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">
</asp:Content>

I am putting them in this placeholder

<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
</asp:Content>
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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