0

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.

3
  • Is this particular function yours, or is it something else which is not being loaded correctly? Commented Feb 6, 2013 at 6:09
  • The first function was the .dialog() function in jquery UI. The second one was one I wrote.
    – Jeremy
    Commented Feb 6, 2013 at 22:21
  • Did you ever get this figured out? Commented Feb 14, 2013 at 19:52

2 Answers 2

1

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?

0

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>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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