Use an articleArticleThe debugging of SharePoint JavaScript started, and found that the Javascript opened in vs2010 is crowded together, it is very difficult to read and debug.
I remember that the 14 hive \ layouts folder contains the debug version of JavaScript. They do not know how to use them.
After research, we found that the issue was described in the msdn Article, which is excerpted as follows.
SharePoint Foundation also instils unminified, DEBUG Versions of. JS files in the same directory, for example, SP. debug. JS, SP. core. debug. JS, SP. ribbon. debug. JS, and sp. runtime. debug. JS, And you can specify whether the DEBUG Versions are used. default master pages in SharePoint Foundation insert a scriptmanager control in web pages, and the scriptmode property of this control is set to auto by default.
You can override this default setting and use the debug. JS files by adding <deployment retail = "false"/> to the system. web section of the web. config file, which is located in the % inetpub % \ wwwroot \ WSS \ virtualdirectories \ 80 directory.
Note: The Impact of the retail value being true on msdn is as follows:
When retail is set to true, ASP. NET disables certain configuration settings such as trace output, custom errors, and debug capabilities.
The default value is false. Do not think much about it first.
As a result, the author directly modifies Web. config as follows:
After saving, an error is returned when any web page is opened. Modify web. config and disable the customerror option. The error message is as follows:
Error message:
It is an error to use a section registered as allowdefinition = 'machineonly' beyond machine. config.
Search again and find that this article has the following explanation of this error message:
This message is displayed when a section definition specifies that it may only be provided in the machine. config file. the identity section is not normally set this way, but it is possible for your ISP to change it in machine. config is they don't want users to be able to override the sections. normally the admin shocould use a location tag with allow override = false to accomplish this, but the results are pretty much the same, the web. config may not contain the section in question. if you control the server you shocould check the configuration section definitions to see if the machineonly attribute is set on the section you are having problems. removing the section that is causing the error will solve the problem, although you will not be able to change the attributes of that section.
This option appears to be provided only in machine. config. The purpose is to prevent users from modifying this option.
Find machine. config in path C: \ WINDOWS \ Microsoft. Net \ framework \ v2.0.50727 \ config and find the following entries:
<Section name = "deployment" type = "system. web. configuration. deploymentsection, system. web, version = 2.0.0.0, culture = neutral, publickeytoken = b03f5f7f11d50a3a "allowdefinition =" machineonly "/>
I deleted allowdefinition = "machineonly" directly, and the problem persists. Further research found that in the article about the iis7.0 Configuration System, the machineonly option is described as follows:
MachineonlyThe section can be set only in applicationhost. config or machine. config. Because this is the default setting, a section that doesn't have an allowdefinition attribute uses this setting automatically.
The author tries to modify this option to machinetoapplication, And the apphostonly operation fails. I also added AllowOverride = "true.
Restore web. config and modify machine. config separately. As a result, the common JS file is loaded in the debugger, instead of the debug JS file.
I consulted an IIS expert and got a reply saying that this option cannot be defined in Web. config. My tests also prove that this conflict cannot be solved.
IIS experts say that if you want to load the debug version of JavaScript, you only need to set debug in <compilation batch = "false" DEBUG = "true"> to true.
The opinion of IIS experts has been tested by the author.
Images and truth
It took an afternoon to prove that the client object model distribution and deployment was completely nonsense.
My debug task only started.
Potholes ~~
Link
==================================
How to debug the OOB Javascript file in SharePoint
References
==================================
Client object model distribution and deployment
Http://msdn.microsoft.com/en-us/library/ie/ee539757.aspx
Scripting debugging in Internet Explorer
Http://blogs.msdn.com/ B /ie/archive/2004/10/26/247912.aspx
Deployment element (ASP. NET settings schema)
Http://msdn.microsoft.com/en-us/library/ms228298.aspx
Introducing IIS 7.0 configuration Architecture
Http://technet.microsoft.com/en-us/library/cc268239.aspx
Scriptmanager. scriptmode Property
Http://msdn.microsoft.com/EN-US/library/system.web.ui.scriptmanager.scriptmode