Javascript Sharepoint功能区按钮单击不在上执行,即
我有一个自定义功能区按钮,正在部署到自定义SharePoint编辑表单。我已经将相同的代码/逻辑部署到其他表单中,没有问题。功能区按钮显示在自定义编辑表单中的正确位置,但是,当我单击它时,它会抛出一个javascript null异常。即使是一个简单的警报也不起作用。这仅在Internet Explorer(所有版本)上发生。它在铬上工作。以下是ribbon elements.xml:Javascript Sharepoint功能区按钮单击不在上执行,即,javascript,internet-explorer,sharepoint,sharepoint-2010,ribbon,Javascript,Internet Explorer,Sharepoint,Sharepoint 2010,Ribbon,我有一个自定义功能区按钮,正在部署到自定义SharePoint编辑表单。我已经将相同的代码/逻辑部署到其他表单中,没有问题。功能区按钮显示在自定义编辑表单中的正确位置,但是,当我单击它时,它会抛出一个javascript null异常。即使是一个简单的警报也不起作用。这仅在Internet Explorer(所有版本)上发生。它在铬上工作。以下是ribbon elements.xml: <Elements xmlns="http://schemas.microsoft.com/share
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction Id="Ribbon.ListForm.Displays" Location="CommandUI.Ribbon.EditForm"
RegistrationId="10000"
RegistrationType="List" Title="Add Ribbon Customization">
<CommandUIExtension xmlns="http://schemas.microsoft.com/sharepoint/">
<CommandUIDefinitions>
<CommandUIDefinition Location="Ribbon.ListForm.Edit.Actions.Controls._children" >
<Button Id="Ribbon.ListForm.Display.Actions.AttachFiles" Command="Command_AttachFiles"
Image16by16="_LAYOUTS/$Resources:core,Language;/IMAGES/formatmap16x16.png" Image16by16Top="-128" Image16by16Left="-144"
Image32by32="_LAYOUTS/$Resources:core,Language;/IMAGES/formatmap32x32.png" Image32by32Top="-352" Image32by32Left="-128"
LabelText="Attach File" TemplateAlias="o1" Sequence="2"/>
</CommandUIDefinition>
</CommandUIDefinitions>
<CommandUIHandlers>
<CommandUIHandler Command="Command_AttachFiles" CommandAction="javascript:alert('Test Ribbon');" />
</CommandUIHandlers>
</CommandUIExtension>
</CustomAction>
</Elements>
知道问题出在哪里吗 尽管这个问题已经很老了,但让我提出一个解决方案: 在IE中调试功能区按钮/行为时,应使用InPrivate模式窗口,每次部署解决方案后应关闭该窗口。IE缓存旧版本的解决方案可能会导致头痛和长时间工作