Tip #110 How to make SharePoint use debug scripts?

Rate this item
(1 Vote)

Recently I have setup a new machine and wanted to dig into some standard SharePoint scripts. The thing is that SharePoint has used all normal minimized scripts (sp.js, core.js) while I want it to run sp.debug.js and code.debug.js

To get the answer we need to get into the component called ScriptLink.

If your script is registered as ScriptLink (as most SharePoint scripts are), then the ScriptLink class can automatically use .debug. scripts if ScriptManager.iSDebuggingEnabled is true.

http://msdn.microsoft.com/en-us/library/system.web.ui.scriptmanager.isdebuggingenabled.aspx

ScriptManager.IsDebugging enabled follows the following logic.

If there is <deployment retail=”true”> – return false.

Else if the script mode is not auto and not inherint, return (ScriptMode = Debug)

Else

return what is set in <compilation debug=”xxx”…/>

So for developer farm the easiest thing to do is go to web.config and set there

<system.web>

<compilation batch="false" debug="true">
      <assemblies>

http://mbakirov.wordpress.com/2013/07/26/how-to-make-sharepoint-use-debug-scripts/

Leave a comment

Make sure you enter the (*) required information where indicated. HTML code is not allowed.